mindspore.mint.swapaxes

mindspore.mint.swapaxes(input, axis0, axis1)[source]

Alias for mindspore.mint.transpose() . The input corresponds to the input in the reference interface, and the parameters axis0 and axis1 correspond to dim0 and dim1 in the reference interface respectively.

For more details, see mindspore.mint.transpose() .

Warning

This is an experimental API that is subject to change or deletion.

Examples

>>> import numpy as np
>>> from mindspore import mint
>>> from mindspore import Tensor
>>> input = Tensor(np.ones((2,3,4), dtype=np.float32))
>>> output = mint.swapaxes(input, 0, 2)
>>> print(output.shape)
(4, 3, 2)