transpose_operator

Function Usage

You can specify a group of axis dimensions (axes) to transpose the input tensor data. If no axis dimension is specified, the tensor data is transposed in reverse order by default.

This function supports only tensor data on the device.

  • The shape of the input tensor cannot exceed four dimensions.

Prototype

transpose_operator(input: Tensor, axes: List[int])

Input Parameters

Parameter

Type

Description

input

Tensor class

Tensor class to be transposed.

2-, 3-, and 4-dimension are supported, and the data type can be base.dtype.float32, base.dtype.float16, and base.dtype.uint8. For details, see Tensor Class Attributes.

axes

List[int]

Transposition option. The length must be the same as the dimension of the input tensor.

  • If an empty list is passed, the vector is transposed in reverse order.
  • If the axes is not an empty list, the elements in axes must contain numbers in the range of [0, size-1], and each number can appear only once. size indicates the dimension of the input tensor.

Response Parameters

Transposed tensor data