You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[PyTorch] Support divisor_override for avg_pool2d and avg_pool3d #2745
ValueError: divisor_override is not supported for avg_pool2d
Expected behavior
Models using a static, nonzero divisor_override should convert successfully when the operation can be represented using MIL operations, while preserving numerical parity with PyTorch.
Possible implementation
For configurations where average pooling uses a fixed full-kernel divisor:
Lower the operation using the existing average-pooling implementation.
Multiply the result by:
number_of_kernel_elements / divisor_override
An initial implementation could support:
avg_pool2d and avg_pool3d
Static kernel dimensions
Positive constant divisor_override
Zero padding, or count_include_pad=True
Cases combining nonzero padding with count_include_pad=False may require separate handling because the effective divisor can vary near boundaries.
I would be happy to implement this and add regression tests if this scope is acceptable.
Activity