I was not able to recreate the error with this.
h = torch.randn(size=(2,10))
permutation_tensor = torch.randn(size=(2,10))
x = torch.mm(h,permutation_tensor.float().transpose(0,1))
print(x)


Can you try running this.