mindspore.ops.swapaxes
- mindspore.ops.swapaxes(input, axis0, axis1)[source]
Interchange two axes of a tensor.
- Parameters
- Returns
Tensor
- Supported Platforms:
Ascend
GPU
CPU
Examples
>>> import mindspore >>> input = mindspore.tensor(mindspore.ops.ones(([2, 3, 4]))) >>> output = mindspore.ops.swapaxes(input, 0, 2) >>> print(output.shape) (4, 3, 2)