transpose

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 can be performed only on the host. To process tensor data on the device, call to_host to transfer the data from the device to the host, and then perform transpose.

Prototype

1
transpose(input: Tensor, axes: List)

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 Properties of the Tensor Class.

axes

List[int]

Transpose option. The default value is null.

If axes are not specified, reverse axes are generated by default to transpose the data in input in reverse order.

For example, the reverse axes generated for a three-dimensional tensor are {2, 1, 0} by default.

Response Parameters

Transposed tensor data

Supported Models

Atlas 200/300/500 inference product

Atlas 200I/500 A2 inference product

Atlas inference product