m = torch.arange(6).reshape(2, 3) print(m.T.shape) # torch.Size([3, 2]) print(m.transpose(0, 1).shape) # torch.Size([3, 2]) — identical