Solved by colesbury in post #2 
              
              
                PyTorch (and other ML frameworks that I know about) actually implement cross-correlation in the functions named convolution. 
The difference is just the reversal of the filter. 
filt = torch.from_numpy(np.ascontiguousarray(testFilt[::-1, ::-1])).type(torch.float32)
filt = filt.unsqueeze(0).unsqueeze…