Skip to content

[Relax][ONNX] Fix Resize coordinate error with non-integer scales#19698

Open
cchung100m wants to merge 9 commits into
apache:mainfrom
cchung100m:issue-19570
Open

[Relax][ONNX] Fix Resize coordinate error with non-integer scales#19698
cchung100m wants to merge 9 commits into
apache:mainfrom
cchung100m:issue-19570

Conversation

@cchung100m

Copy link
Copy Markdown
Contributor

Hi Committers,

This PR fixes issues #19570. Any suggestions would be appreciated if you are available.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request preserves original spatial scales during ONNX frontend coordinate transformations to avoid lossy ratios, propagating scale overrides through the 1D, 2D, and 3D image resize operations in TOPI. Feedback on these changes highlights a critical typo (sacle_x_override) in resize.py that will cause a runtime NameError, the fact that the newly defined original_spatial_scales in onnx_frontend.py is never actually used or passed to the resize operators, and a minor PEP 8 style violation regarding spaces around keyword argument assignments.

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.

Comment thread python/tvm/topi/image/resize.py Outdated
Comment thread python/tvm/relax/frontend/onnx/onnx_frontend.py Outdated
Comment thread python/tvm/topi/image/resize.py Outdated
@cchung100m

Copy link
Copy Markdown
Contributor Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request preserves the original spatial scales in the ONNX frontend resize operations to prevent lossy coordinate transformations with non-integer scales. It updates TOPI resize functions to accept scale overrides and adds corresponding unit tests. The review feedback suggests fixing a typo in a comment and using topi_mode instead of relax_mode in the 3D resize implementation for consistency.

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.

Comment thread python/tvm/relax/frontend/onnx/onnx_frontend.py Outdated
Comment thread python/tvm/relax/frontend/onnx/onnx_frontend.py Outdated
@cchung100m cchung100m marked this pull request as ready for review June 11, 2026 17:00
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