mindspore.numpy.transpose
- mindspore.numpy.transpose(a, axes=None)[source]
Reverses or permutes the axes of a tensor; returns the modified tensor.
- Parameters
- Returns
Tensor, the transposed tensor array.
- Raises
TypeError – If input arguments have types not specified above.
ValueError – If the number of axes is not euqal to a.ndim.
- Supported Platforms:
Ascend
GPU
CPU
Examples
>>> import mindspore.numpy as np >>> x = np.ones((1,2,3)) >>> x = np.transpose(x) >>> print(x.shape) (3, 2, 1)