A simple 6x6 matrix
mg_data = [[10, 10, 10, 0, 0, 0],
        [10,10,10, 0, 0, 0],

        [10,10,10, 0, 0,0],

        [10,10,10, 0, 0,0],

        [10,10,10, 0, 0,0],

        [10,10,10, 0, 0,0]]

And a 3x3 kernel or filter
f_data = [[1,0,-1],
      [1,0,-1],

      [1,0,-1]]

How do I do a simple convolution operation using Stride = 1 and padding = 0 in Pytorch.
The output should look like this:
[[0, 30, 30, 0],
[0, 30, 30, 0],
[0, 30, 30, 0],
[0, 30, 30, 0]]