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
Implements inverse hyperbolic operations (fix for #7531) #10598
Conversation
Can one of the admins verify this patch? |
@tensorflow-jenkins test this please |
I ran the tests which failed here on my machine and found that the only cases which were failing are the ones in which |
@tensorflow-jenkins test this please |
The failures in tests/build seem unrelated to the changes made by this pull request. |
Jenkins, test this please. |
The cwise ops test failure (only on Windows, ugh) is probably caused by this CL -- the tolerances appear to be too tight. |
Any hints on how to proceed? |
I would look at which test fails, exactly, and adjust the tolerance for that test in the test code. I think the values are still close so this is not a real problem, just numerics and a particularly unfriendly function. |
If that is the case then this PR would have to wait for a few days since I do not have access to my machine and would be able to fix it only after the 16th. BTW since I do not have a windows machine, how can I identify the function which is failing? |
No problem. |
This test failure is not due to this PR. We'll review API changes on Monday, should be able to merge then. |
Great, thanks! |
Since the tests for |
@lakshayg that should give 1/0 = inf. I'm not sure why it produces NaN instead of inf, but that is unrelated to your change. |
@rmlarsen I just compiled the binary and checked what it gave for x=1 and the answer is |
@martinwicke This is ready to be merged. You added the API review tag. What needs to be done? |
@lakshayg could you please rebase to resolve conflicts? |
@martinwicke I missed your earlier comment about API review last monday. I'll assign you on this PR and you can merge when it's approved. |
@rmlarsen rebase done! |
@lakshayg Thanks! |
How about renaming to arcsinh, arccosh, arctanh to match the numpy names? |
@jhseu I guess then we would have to rename asin, acos and atan as well. |
Yes, but perhaps wait for API review for the final word. |
@jhseu We already have atan, atan2, asin etc. so it doesn't make sense unless we change the existing interface. |
@jhseu or @martinwicke : to confirm, good to go? |
Good for API review, but watch out, this will require Eigen changes to pull in. |
I see failures in windows CPU and GPU build due to additions from this change:
Looks like there is some flakiness in arccosh implementation on windows? |
REGISTER_SYCL_KERNEL(float); | ||
REGISTER_SYCL_KERNEL(double); | ||
#undef REGISTER_SYCL_KERNEL | ||
#endif // TENSORFLOW_USE_SYC |
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.
We should fix this typo in another PR.
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.
Sent in a PR for the typo SYC -> SYCL #11204 fixed!
It was suggested earlier #10598 (comment) that I change the tolerances for those but since the tests passed on the next build, I did not change the tolerances. Should I go ahead and change them? @gunan @drpngx @martinwicke |
It's not just the tolerance, check this out:
|
template<typename T> struct scalar_acosh_op { | ||
EIGEN_EMPTY_STRUCT_CTOR(scalar_acosh_op) | ||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const T operator()(const T& a) const { | ||
return std::acosh(a); |
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's surprising that everything works fine on Linux and fails on Windows. It is extremely unlikely but could it have something to do with the standard library implementation of acosh, since that is what is used in the background for computation.
…ensorflow#10598) * Implemented asinh op * Implemented acosh op * Fixed test functions for acosh and asinh * Implemented atanh op * Fixed test cases for atanh
fixes #7531.