-
Notifications
You must be signed in to change notification settings - Fork 72
[torchlib] Implement floor_divide for int inputs #2343
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
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 adds support for integer inputs to the floor_divide
operator by implementing a new integer-specific variant and registering it in the test suite.
- Introduce
aten_floor_divide_int
in core operators, casting ints to float, applyingFloor(Div)
, then casting back - Register the new
.int
variant inops_test_data.py
- Include a TODO to simplify once input constraints can be enforced
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
tests/function_libs/torch_lib/ops_test_data.py | Add ops.aten.floor_divide.int entry for new int op |
onnxscript/function_libs/torch_lib/ops/core.py | Implement aten_floor_divide_int operator logic |
Comments suppressed due to low confidence (1)
tests/function_libs/torch_lib/ops_test_data.py:802
- No test cases for the new integer
floor_divide
operator have been provided. Add data (including negative and edge values) to verify correct floor behavior for ints.
TorchLibOpInfo("ops.aten.floor_divide.int", core_ops.aten_floor_divide_int),
❌ 14 Tests Failed:
View the top 3 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
Fix #2342