Recently I've trained a neural network using pytorch and there is an average pooling layer with padding in it. And I'm confused about the behavior of it as well as the definition of average pooling with padding.
For example, if we have a input tensor:
[[1, 2, 3],
[4, 5, 6],
[7, 8, 9]]
When padding is one and kernel size 3, the input to the first kernel should be:
0, 0, 0
0, 1, 2
0, 4, 5
The output from the pytorch is 12/4 = 3 (ignoring padded 0), but I think it should be 12/9 = 1.333
Can anyone explain this to me?
Much appreciated.