I am using torch.mm but for some reason I am getting this error: RuntimeError: matrices expected, got 1D, 2D tensors at /pytorch/aten/src/TH/generic/THTensorMath.cpp:131
here is a small portion of what I am doing using the torch.mm function :
h = self.Layer(x)
x = torch.mm(h,Permutation_tensor.float().transpose(0,1))
Actually, I am doing this in order to permute the elements at the position 5 to the position 2 and 3 to 4 etc. You got the idea, I think so any help would be very good
Hy @SandPhoenix, I guess your input ‘h’ is 1-D and the function expect matrices.
I am using tensors
for example, the size of h is [2,10] so it is not 1D
This is why I am finding the error strange
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.
I did, I run into the same error!
Hy @SandPhoenix can you post the complete error.