mindspore.numpy.transpose
- mindspore.numpy.transpose(a, axes=None)[源代码]
Reverses or permutes the axes of a tensor; returns the modified tensor.
- 参数
- 返回
Tensor, the transposed tensor array.
- 异常
TypeError – If input arguments have types not specified above.
ValueError – If the number of axes is not equal to a.ndim.
- Supported Platforms:
Ascend
GPU
CPU
样例
>>> import mindspore.numpy as np >>> x = np.ones((1,2,3)) >>> x = np.transpose(x) >>> print(x.shape) (3, 2, 1)