torch.adjoint

torch.adjoint(Tensor) Tensor

返回张量的共轭视图,并交换最后两个维度。

x.adjoint() 等同于复数张量的 x.transpose(-2, -1).conj(),对于实数张量则等同于 x.transpose(-2, -1)

示例:
>>> x = torch.arange(4, dtype=torch.float)
>>> A = torch.complex(x, x).reshape(2, 2)
>>> A
tensor([[0.+0.j, 1.+1.j],
        [2.+2.j, 3.+3.j]])
>>> A.adjoint()
tensor([[0.-0.j, 2.-2.j],
        [1.-1.j, 3.-3.j]])
>>> (A.adjoint() == A.mH).all()
tensor(True)
本页目录