[Relax][Onnx][Resize] Fix ROI values when tensor ROI is Empty pass node Constant#18691
Conversation
…ode Constant - Fill value 0.0 into tensor ROI
Summary of ChangesHello @locnd182644, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses a critical bug in the ONNX frontend's handling of the Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request correctly fixes an IndexError in the ONNX Resize operator frontend when an empty constant tensor is passed for the roi input. The fix handles this edge case by treating it similarly to a None roi, which is appropriate. The added test cases effectively cover this scenario, including variations where roi is provided as a Constant node or an initializer. I've also noted a minor typo fix in an assertion message, which is a good catch.
I have one suggestion to improve the new test cases by ensuring unique test IDs to avoid potential issues with test runners.
| roi_list.append(pytest.param(True, roi, True, id=f"roi_{'_'.join(str(x) for x in roi)}")) | ||
| roi_list.append(pytest.param(True, roi, False, id=f"roi_{'_'.join(str(x) for x in roi)}")) |
There was a problem hiding this comment.
The pytest.param calls inside this loop generate duplicate test IDs. For example, when roi is [], both calls will have id="roi_". This can cause issues with test discovery and reporting. To ensure unique test IDs, you should include information about whether roi is a constant or an initializer in the ID string.
| roi_list.append(pytest.param(True, roi, True, id=f"roi_{'_'.join(str(x) for x in roi)}")) | |
| roi_list.append(pytest.param(True, roi, False, id=f"roi_{'_'.join(str(x) for x in roi)}")) | |
| roi_list.append(pytest.param(True, roi, True, id=f"const_roi_{'_'.join(str(x) for x in roi)}")) | |
| roi_list.append(pytest.param(True, roi, False, id=f"initializer_roi_{'_'.join(str(x) for x in roi)}")) |
This PR fix ROI values when tensor ROI is Empty pass Constant node in Resize Operator
Description:
Step to Reproduce:
Resolve: