-
Notifications
You must be signed in to change notification settings - Fork 97
[torchlib] Implement signbit #2754
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 implements the signbit operation for the torch library, which tests each element of the input tensor to determine if the sign bit is set (i.e., if the value is negative). The implementation also updates the sign operation to properly handle boolean input tensors.
Key Changes
- Implements
aten_signbitfunction to check if elements have their sign bit set - Updates
aten_signto handle boolean dtype inputs by returning an identity operation - Adds test registration for the
signbitoperation
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| onnxscript/function_libs/torch_lib/ops/core.py | Implements aten_signbit function and updates aten_sign to handle bool dtype |
| tests/function_libs/torch_lib/ops_test_data.py | Registers signbit operation for testing |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2754 +/- ##
==========================================
+ Coverage 70.09% 70.10% +0.01%
==========================================
Files 228 228
Lines 27382 27387 +5
Branches 2783 2785 +2
==========================================
+ Hits 19194 19201 +7
+ Misses 7229 7227 -2
Partials 959 959 ☔ View full report in Codecov by Sentry. |
No description provided.