RuntimeError: Expected tensor for argument #1 ‘input’ to have the same dimension as tensor for ‘result’; but 4 does not equal 2 (while checking arguments for cudnn_convolution)
Is this a bug in pytorch library?
In forward function, my x is 2D, so I do:
x = x.unsqueeze(0)
to make it 3D and anything else is the same as the example.
From the link you’ve posted, it seems that one spatial dimension is smaller than the kernel size. Could you check that?
Also, it’s strange that the CPU code runs without an error, while your GPU code crashes as @justusschock mentioned. Could you print the shapes of your input and the conv layer setup?