-
Notifications
You must be signed in to change notification settings - Fork 72
[torchlib] Fix aten_div rounding_mode #2147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
❌ 6 Tests Failed:
View the top 3 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes the behavior of aten_div rounding_mode by updating the functions aten_div_mode and aten_div_mode_int to allow an optional rounding_mode argument.
- Remove test skip for the integer division operation in the torch lib tests.
- Update rounding_mode handling in aten_div_mode and aten_div_mode_int in the core ops module.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
File | Description |
---|---|
tests/function_libs/torch_lib/ops_test_data.py | Unskips the "div_mode_int" test case by removing the skip configuration. |
onnxscript/function_libs/torch_lib/ops/core.py | Allows an optional rounding_mode for division operations and adjusts the branch logic accordingly. |
Comments suppressed due to low confidence (1)
onnxscript/function_libs/torch_lib/ops/core.py:2874
- In aten_div_mode_int, if rounding_mode is None, 'result' is not defined before it is used. Consider adding an explicit branch that handles the case when rounding_mode is None.
return op.CastLike(result, self)
Fix #2144