-
Notifications
You must be signed in to change notification settings - Fork 83
Improve aten_floor_divide for int inputs #2592
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
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
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 improves the aten_floor_divide
operator implementation to properly handle integer inputs, particularly negative and large integer values. The changes consolidate two separate floor divide functions into a single implementation that handles both floating-point and integer types correctly.
- Consolidated
aten_floor_divide
andaten_floor_divide_int
into a single function - Added proper handling for signed vs unsigned integer division
- Implemented correct floor division logic for signed integers using offset calculation
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
tests/function_libs/torch_lib/ops_test_data.py | Removed the separate integer floor divide test entry |
tests/function_libs/torch_lib/extra_opinfo.py | Consolidated test configuration to support all types and removed integer-specific constraints |
onnxscript/function_libs/torch_lib/ops/core.py | Unified floor divide implementation with proper integer handling logic |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2592 +/- ##
==========================================
- Coverage 70.07% 70.06% -0.01%
==========================================
Files 223 223
Lines 26266 26266
Branches 2602 2604 +2
==========================================
- Hits 18405 18403 -2
- Misses 6950 6951 +1
- Partials 911 912 +1 ☔ View full report in Codecov by Sentry. |
Fix aten_floor_divide for negative int inputs and large int inputs. I also combined the int and float overloads for #2580
Fix #2589