nvidia.dali.fn.sequence_rearrange#
- nvidia.dali.fn.sequence_rearrange(__input, /, *, bytes_per_sample_hint=[0], new_order, preserve=False, device=None, name=None)#
Rearranges frames in a sequence.
Assumes that the outermost dimension represents the frame index in the sequence. If the input has a non-empty layout description, it must start with
F
(frame).This operator allows sequence inputs.
- Supported backends
‘cpu’
‘gpu’
- Parameters:
__input¶ (TensorList) – Input to the operator.
- Keyword Arguments:
bytes_per_sample_hint¶ (int or list of int, optional, default = [0]) –
Output size hint, in bytes per sample.
If specified, the operator’s outputs residing in GPU or page-locked host memory will be preallocated to accommodate a batch of samples of this size.
new_order¶ (int or list of int or TensorList of int) –
List that describes the new order for the elements in each sample.
Output sequence at position
i
will contain elementnew_order[i]
from input sequence:out[i, ...] = in[new_order[i], ...]
Elements can be repeated or dropped, but empty output sequences are not allowed. Only indices in
[0, input_outermost_extent)
are allowed to be used innew_order
. Can be specified per sample as 1D tensors.preserve¶ (bool, optional, default = False) – Prevents the operator from being removed from the graph even if its outputs are not used.