I have two tensors in PyTorch:
tensor1 = torch.rand(4, 2)
tensor2 = torch.rand(10, 4)
I want to transpose the first one, to be able to then concatenate it to the second.
tensor1_t = torch.transpose(tensor1, 0, 1)
concat_tensor = torch.cat((tensor1_t, tensor2), dim=0)
assert concat_tensor.shape[0] == tensor1_t.shape[1] + tensor2.shape[0]
assert concat_tensor.shape[1] == tensor1_t.shape[0]
But doing like this gives me unspecified AssertionError. Can someone help me figure this out?