nvidia.dali.fn.transpose — NVIDIA DALI (original) (raw)

nvidia.dali.fn.transpose(__input, /, *, bytes_per_sample_hint=[0], output_layout='', perm=None, preserve=False, transpose_layout=True, device=None, name=None)#

Transposes the tensors by reordering the dimensions based on the perm parameter.

Destination dimension i is obtained from source dimension perm[i].

For example, for a source image with HWC layout, shape = (100, 200, 3), and perm = [2, 0, 1], it will produce a destination image with CHWlayout and shape = (3, 100, 200), holding the equality:

\[dst(x_2, x_0, x_1) = src(x_0, x_1, x_2)\]

which is equivalent to:

\[dst(x_{perm[0]}, x_{perm[1]}, x_{perm[2]}) = src(x_0, x_1, x_2)\]

for all valid coordinates.

This operator allows sequence inputs and supports volumetric data.

Supported backends

Parameters:

__input (TensorList) – Input to the operator.

Keyword Arguments: