Thank you for your reply.
So, I did
out = torch.matmul(F1.view(-1, h2 * w2), F2.view(-1, h2 * w2) .t())
print(out.shape)

And the output shape is:
torch.Size([160, 320])

But it should be [10, 16, 32]