This op first slices input along the dimension batch_axis, and for
each slice i, reverses the first seq_lengths[i] elements along the
dimension seq_axis.
The elements of seq_lengths must obey seq_lengths[i] <=
input.dims[seq_dim], and seq_lengths must be a vector of length
input.dims[batch_dim].
The output slice i along dimension batch_axis is then given by
input slice i, with the first seq_lengths[i] slices along
dimension seq_axis reversed.
input: A Tensor. The input to reverse.
seq_lengths: A Tensor. Must be one of the following types: int32,
int64. 1-D with length input.dims(batch_dim) and max(seq_lengths) <=
input.dims(seq_dim)seq_axis: An int. The dimension which is partially reversed.
batch_axis: An optional int. Defaults to 0. The dimension along which
reversal is performed.
name: A name for the operation (optional).
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2020-10-01 UTC."],[],[],null,["# tf.reverse_sequence\n\n\u003cbr /\u003e\n\n|-----------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------|\n| [TensorFlow 1 version](/versions/r1.15/api_docs/python/tf/reverse_sequence) | [View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v2.2.0/tensorflow/python/ops/array_ops.py#L4418-L4429) |\n\nReverses variable length slices. (deprecated arguments) (deprecated arguments) \n\n tf.reverse_sequence(\n input, seq_lengths, seq_axis=None, batch_axis=None, name=None\n )\n\n| **Warning:** SOME ARGUMENTS ARE DEPRECATED: `(seq_dim)`. They will be removed in a future version. Instructions for updating: seq_dim is deprecated, use seq_axis instead\n| **Warning:** SOME ARGUMENTS ARE DEPRECATED: `(batch_dim)`. They will be removed in a future version. Instructions for updating: batch_dim is deprecated, use batch_axis instead\n\nThis op first slices `input` along the dimension `batch_axis`, and for\neach slice `i`, reverses the first `seq_lengths[i]` elements along the\ndimension `seq_axis`.\n\nThe elements of `seq_lengths` must obey `seq_lengths[i] \u003c=\ninput.dims[seq_dim]`, and `seq_lengths` must be a vector of length\n`input.dims[batch_dim]`.\n\nThe output slice `i` along dimension `batch_axis` is then given by\ninput slice `i`, with the first `seq_lengths[i]` slices along\ndimension `seq_axis` reversed.\n\n#### Example usage:\n\n seq_lengths = [7, 2, 3, 5]\n input = [[1, 2, 3, 4, 5, 0, 0, 0], [1, 2, 0, 0, 0, 0, 0, 0],\n [1, 2, 3, 4, 0, 0, 0, 0], [1, 2, 3, 4, 5, 6, 7, 8]]\n output = tf.reverse_sequence(input, seq_lengths, seq_axis=1, batch_axis=0)\n output\n \u003ctf.Tensor: shape=(4, 8), dtype=int32, numpy=\n array([[0, 0, 5, 4, 3, 2, 1, 0],\n [2, 1, 0, 0, 0, 0, 0, 0],\n [3, 2, 1, 4, 0, 0, 0, 0],\n [5, 4, 3, 2, 1, 6, 7, 8]], dtype=int32)\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|---|---|\n| `input`: A `Tensor`. The input to reverse. `seq_lengths`: A `Tensor`. Must be one of the following types: `int32`, `int64`. 1-D with length `input.dims(batch_dim)` and `max(seq_lengths) \u003c= input.dims(seq_dim)` `seq_axis`: An `int`. The dimension which is partially reversed. `batch_axis`: An optional `int`. Defaults to `0`. The dimension along which reversal is performed. `name`: A name for the operation (optional). ||\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ------- ||\n|---|---|\n| A Tensor. Has the same type as input. ||\n\n\u003cbr /\u003e"]]