Skip to content

Handle empty default strides in pooling lowerings - #81

Open
devin-lai wants to merge 1 commit into
apple:mainfrom
devin-lai:fix/pool-empty-stride
Open

devin-lai wants to merge 1 commit into
apple:mainfrom
devin-lai:fix/pool-empty-stride

Conversation

@devin-lai

Copy link
Copy Markdown

ATen represents the default pooling stride as an empty list. Exported nodes keep that value when a later argument is non-default, but the lowerings only handled absent or None strides and failed on the empty list.

This resolves all three default forms to kernel_size for avg_pool2d, avg_pool3d, and max_pool2d_with_indices. End-to-end tests cover each affected path.

Tested with pytest -q tests/ops/test_ops.py::test_avg_pool2d tests/ops/test_ops.py::test_avg_pool3d tests/ops/test_ops.py::test_maxpool2d...

ATen represents the default pooling stride as an empty list. Exported nodes retain that list whenever a later argument is non-default, but the lowerings only treated an absent or None stride as the default and subsequently failed on the empty value.

Resolve absent, None, and empty strides to kernel_size for avg_pool2d, avg_pool3d, and max_pool2d_with_indices. Add end-to-end coverage for each affected lowering.
@jakesabathia2
jakesabathia2 requested review from TobyRoseman and gokulkrishna98 and removed request for gokulkrishna98 September 9, 2026 23:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant