-
Notifications
You must be signed in to change notification settings - Fork 3.8k
BitwiseNot implementation #4497
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
LGTM, thanks! The only question is whether some of the ops should be defined as functions in terms of others. |
ad84f41
to
ffba00b
Compare
Thanks for the review!
I think bitwise ops are sufficiently primitive where it may be overkill to make some of these functions. From my understanding most chips and hardware accelerators have first class support for these bitwise operations. However if you feel that this is best done with functions, I can try and figure out how to do that. |
Not necessary. I think this is fine. I agree that in practice, it won't make a big difference. |
Signed-off-by: Philip Lassen <philiplassen+git@gmail.com>
ffba00b
to
583b359
Compare
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.
Would testing 0d tensor inputs (scalars, essentially) bring any benefits? LGTM.
@p-wysocki thanks for the review! I checked other unary and binary ops. And it seems that most times 0d tensors aren't checked. If you feel it would add more coverage, then I am happy to add tests. |
Signed-off-by: Philip Lassen <philiplassen+git@gmail.com> Signed-off-by: Philip Lassen <philiplassen+git@gmail.com>
Signed-off-by: Philip Lassen philiplassen+git@gmail.com
Description
This PR implements the BitwiseNot operator. I've implemented the Binary bitwise operators in #4496.
Motivation and Context
With this PR and #4496 we have implementations for the same set of bitwise operators numpy has support for.
np.bitwise_and
np.bitwise_or
np.bitwise_xor
np.bitwise_not
The are also the same set of Ops which already have a ONNX logical equivalent.
And
,Or
,Xor
, andNot
. In ONNX these take booleans and return booleans. This also touches on @AlexandreEichenberger's comments in #4343