I have two tensors in PyTorch as:
a.shape, b.shape
# (torch.Size([512, 28, 2]), torch.Size([512, 28, 26]))
My goal is to join/merge/concatenate them together so that I get the shape: (512, 28, 28).
I tried:
torch.stack((a, b), dim = 2).shape
torch.cat((a, b)).shape
But none of them seem to work.
I am using PyTorch version: 1.11.0 and Python 3.9.
Help?