mindspore.Tensor.H

property mindspore.Tensor.H

返回共轭和转置的矩阵(2-D Tensor)的视图。如果输入x是复数矩阵,x.H等价于 mindspore.Tensor.swapaxes(0, 1).conj(),如果是实数矩阵则等价于 mindspore.Tensor.swapaxes(0, 1)

支持平台:

Ascend GPU CPU

样例:

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