Solved by JuanFMontesinos in post #2 
              
              
                Pytorch does correlation, not convolution. It is explicitly said in docs. https://pytorch.org/docs/stable/nn.html#torch.nn.Conv2d