t = torch.arange(24) print(t.reshape(4, -1).shape) # (4, 6) print(t.reshape(-1, 3).shape) # (8, 3) print(t.reshape(2, 3, -1).shape) # (2, 3, 4)