I’m not sure what your notation means exactly, but you could use a simple example as given here:
weight = torch.ones(1, 1, 2, 2)
x = torch.arange(4*4).view(1, 1, 4, 4).float()
print(weight)
> tensor([[[[1., 1.],
[1., 1.]]]])
print(x)
> tensor([[[[ 0., 1., 2., 3.],
[ 4., 5., 6., 7.],
[ 8., 9., 10., 11.],
[12., 13., 14., 15.]]]])
out = F.conv2d(x, weight, stride=1, padding=0)
print(out)
> tensor([[[[10., 14., 18.],
[26., 30., 34.],
[42., 46., 50.]]]])
out = F.conv2d(x, weight, stride=1, padding=1)
print(out)
> tensor([[[[ 0., 1., 3., 5., 3.],
[ 4., 10., 14., 18., 10.],
[12., 26., 30., 34., 18.],
[20., 42., 46., 50., 26.],
[12., 25., 27., 29., 15.]]]])
As you can see, the kernel will use windows of 2x2
to create its output.
Let me know, if this example makes the output clear or if you would need more information.