torch.adjoint¶
- torch.adjoint(input: Tensor) Tensor ¶
傳回張量的共軛視圖,並將最後兩個維度轉置。
x.adjoint()
等同於複數張量的x.transpose(-2, -1).conj()
,以及實數張量的x.transpose(-2, -1)
。- 參數
{input} –
- 範例:
>>> 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)