torch.nn.functional.avg_pool2d make error.
RuntimeError: pad should be smaller than or equal to half of kernel size, but got padW = 5, padH = 5, kW = 9, kH = 9
However, this is intended usecase.
I don’t know why pytorch’s implementation chose assert padW <= kW//2 and padH <= kH // 2
instead of assert padW < kW and padH < kH
.
There is an inconvenience in that padding for input must be performed before avgpool2d.
I’m asking if it’s an inevitable choice for pytorch’s optimization or if it’s a bug.
Or is the problem solved in the latest pytorch version?