fn
t
→Tensort(x: Tensor)Short-form transpose for tensors of rank at most 2.
A convenience analogue of MATLAB's A' or the reference
framework's Tensor.t(): returns the transpose of a 2-D matrix,
or the input unchanged for 0-D and 1-D tensors.
Parameters
xTensorInput tensor with at most 2 dimensions.
Returns
TensorFor ndim <= 1, returns x unchanged.
For ndim == 2, returns the 2-D transpose.
Raises
RuntimeErrorIf
x has 3 or more dimensions.Notes
Defined as
Use adjoint or lucid.transpose for batched / higher
rank inputs.
Examples
>>> import lucid
>>> A = lucid.tensor([[1., 2.], [3., 4.], [5., 6.]])
>>> lucid.t(A).shape
(2, 3)