-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
added instance method isfinite to pytorch tensor (pytorch frontend) #22010
Conversation
Thanks for contributing to Ivy! 😊👏 |
I am not able to link the corresponding issue under development. It is: isfinite #21943 |
If you are working on an open task, please edit the PR description to link to the issue you've created. For more information, please check ToDo List Issues Guide. Thank you 🤗 |
The tests are not passing. Please fix this and request a review
|
The test test_torch_tensor_isfinite now passes (when run with pytest in my environment), there remain unsuccessful checks, but the error messages are not very telling. Where should I look instead? |
@umairjavaid Can't request a review in the sidebar -- it just says 'No reviews'. Can you please help with the above question? |
@with_unsupported_dtypes( | ||
{ | ||
"2.0.1 and below": ( | ||
"bfloat16", |
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.
I just checked isfinite supports bfloat16
{ | ||
"2.0.1 and below": ( | ||
"bfloat16", | ||
"bool", |
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.
bool is also supported
"2.0.1 and below": ( | ||
"bfloat16", | ||
"bool", | ||
"uint8", |
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.
uint8 is also supported
"bfloat16", | ||
"bool", | ||
"uint8", | ||
"int8", |
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.
int8 is also supported
"bool", | ||
"uint8", | ||
"int8", | ||
"int16", |
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.
int16 is also supported
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.
But all those tests fail at a deeper level than this instance method. What's the reason for that?
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.
It seems that they are not supported in certain backends? How do I change that?
"uint8", | ||
"int8", | ||
"int16", | ||
"complex64", |
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.
complex64 is also supported
"int8", | ||
"int16", | ||
"complex64", | ||
"complex128", |
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.
complex128 is also supported
But all those tests fail at a deeper level than this instance method (if I exclude the dtype ommissions). What's the reason for that? |
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.
Please remove the supported dtype from the @with_unsupported_dtypes
I can do that, but then the tests will fail. (See my comment above this one.) |
I have removed the supported dtypes as requested. Now the tests fail. |
Just for comparison, I ran the tests for the very similar instance method isinf -- same test failures. Please let me know what to do about this PR. |
You need add bool to the unsupported dtype decorator of the isfinite tensorflow backend function, so that bool is not passed to it during testing. Similarly, you also need to implement isfinite in paddle backend if it's missing along with its unsupported dtype decorator. |
Thank you! This was very helpful. I have added bool to unsupp dtypes in tensorflow backend. The function isfinite in the paddle backend is already implemented along with the unsupported dtype decorator (which looks correct to me) and I don't know why it's not found during test. Similarly, I don't know why the test for the torch backend fails; as far as I can see bfloat16 should be supported. |
Hi, I have added the instance method isfinite.
Close #21943
Would you please have a look? Thanks!