Solved by my3bikaht in post #2 
              
              
                Conv2d expects 4 dimensions (batch num of samples, num of channels, h, w) 
if you want to pass single tensor, use unsqueeze(0) to add extra dimension in front of your tensor.