contiguous Returns a contiguous in memory tensor containing the same data as self tensor. If self tensor is already in the specified memory format, this function returns the self tensor. Let's just define two tensors that shape are same. a = torch.randn(3, 4) a.transpose_(0, 1) b = torch.randn(4, 3) # both tensor shape is (4, 3) print(a) >>> tensor([[-0.7290, 0.7509, 1.1666], [-0.9321, -0.4360, ..