[Relax][ONNX] Support align_corners in AffineGrid op#19864
Conversation
There was a problem hiding this comment.
Code Review
This pull request adds support for the align_corners attribute in the Relax affine_grid operator, allowing both corner-aligned and pixel-center-aligned coordinate mappings. This enables full support for ONNX's default align_corners=0 behavior. The feedback suggests removing a redundant bool() conversion in the legalization pass and relaxing an assertion in the TOPI implementation that restricts target dimensions to be greater than 1, which is only necessary when align_corners is enabled.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
5cb3fe1 to
c342721
Compare
cbalint13
left a comment
There was a problem hiding this comment.
LGTM, thanks @guan404ming !
|
Thanks @cbalint13! |
Related Issue
closes #19690
Why
ONNX AffineGrid carries an align_corners attribute, but the Relax op ignored it and always produced the align_corners=1 grid.
How