Convenience method of transpose()
for 2D
tensors. The given tensor must be 2 dimensional. Swap dimensions 1 and 2.
> x = torch.Tensor(3,4):zero() > x:select(2,3):fill(7) > y = x:t() > print(y) 0 0 0 0 0 0 7 7 7 0 0 0 [torch.Tensor of dimension 4x3] > print(x) 0 0 7 0 0 0 7 0 0 0 7 0 [torch.Tensor of dimension 3x4]