tensor.reverse_sequence
Reverse batch of sequences having different lengths specified by sequence_lens.
self
(@Array<Tensor<T>>
) - Tensor of rank r >= 2.sequence_lens
(@Tensor<T>
) - Tensor specifying lengths of the sequences in a batch. It has shape [batch_size].batch_axis
(Option<usize>
) - (Optional) Specify which axis is batch axis. Must be one of 1 (default), or 0.time_axis
(Option<usize>
) - (Optional) Specify which axis is time axis. Must be one of 0 (default), or 1.
Panics
Panics if the 'batch_axis' == 'time_axis'.
Panics if the 'batch_axis' and 'time_axis' are not 0 and 1.
Panics if the 'sequence_len' exceeding the sequence range.
Returns
Tensor with same shape of input.
Example
Last updated