fn
adjoint
→Tensoradjoint(x: Tensor)Conjugate (Hermitian) transpose of the trailing two dimensions.
For real-valued tensors this is identical to a plain transpose of the last two axes. For complex tensors (when supported), the entries are additionally conjugated, yielding the Hermitian transpose .
Parameters
xTensorInput tensor with at least 2 dimensions.
Returns
TensorTensor with the last two axes swapped (and complex conjugated when applicable).
Raises
ValueErrorIf
x.ndim < 2.Notes
Mathematical definition:
For real inputs the conjugation step is a no-op, so this is simply a permutation of the last two axes. Batch dimensions are preserved.
Examples
>>> import lucid
>>> A = lucid.tensor([[1., 2., 3.], [4., 5., 6.]])
>>> lucid.adjoint(A)
Tensor([[1., 4.],
[2., 5.],
[3., 6.]])