mindspore.Tensor.H

property Tensor.H

Returns a view of a matrix (2-D tensor) conjugated and transposed. x.H is equivalent to mindspore.Tensor.swapaxes(0, 1).conj() for complex matrices and mindspore.Tensor.swapaxes(0, 1) for real matrices.

Supported Platforms:

Ascend GPU CPU

Examples

>>> 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]]