Transpose a 2D matrix (swap rows and columns).
Input: A 2D tensor x of shape (m, n)
x
(m, n)
Output: A 2D tensor of shape (n, m) that is the transpose of x.
(n, m)
API Reference:
x.T
x.t()
torch.transpose(x, 0, 1)
jnp.transpose(x)