mindspore.Tensor.t

Tensor.t()

Transpose self .

Warning

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

Returns

Tensor, transpose 2D tensor, return 1D tensor as it is.

Raises
Supported Platforms:

Ascend

Examples

>>> import mindspore
>>> import numpy as np
>>> from mindspore import Tensor
>>> x = Tensor(np.array([[1, 2, 3], [4, 5, 6]]), mindspore.float32)
>>> output = x.t()
>>> print(output)
[[ 1. 4.]
 [ 2. 5.]
 [ 3. 6.]]