-
Notifications
You must be signed in to change notification settings - Fork 349
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
feat: support aten.isnan converter #2711
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.
LGTM! Just one comment below.
input: TRTTensor, | ||
) -> TRTTensor: | ||
# False for NaN elements since NaN is not equal to anything, including itself. | ||
equality_result = impl.elementwise.ops.eq( |
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.
For consistency, you can directly call impl.elementwise.eq()
because the eq
is exposed.
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.
Thank you! I changed it!
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.
LGTM!
Description
In TRT, there isn't a direct way to check for NaN values, so I used a clever method. This method involves comparing the tensor to itself; input == input will only be false when dealing with NaN values.
Fixes # (issue)
Type of change
Checklist: