mindspore.Tensor.T

查看源文件
property mindspore.Tensor.T

返回转置后的Tensor。

样例:

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