-
Notifications
You must be signed in to change notification settings - Fork 74k
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
Add complex data type support for tf.math.acos in XLA #41386
Add complex data type support for tf.math.acos in XLA #41386
Conversation
This PR tries to address the issur raised in 41370 where tf.math.acos throws out error with complex input data. The issue was that in XLA the `Acos` op does not capture the complex data types. This PR adds complex support for tf.math.acos in XLA This PR fixes 41370. Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
return b->ReportErrorOrReturn([&]() -> StatusOr<XlaOp> { | ||
TF_ASSIGN_OR_RETURN(auto shape, b->GetShape(x)); | ||
|
||
// complex: acos(x) = -i * log(x + sqrt(-(x+1)*(x-1))) |
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.
The code on line 1127 multiplies the sqrt
by -i
. The expression inside the sqrt
is also a bit different.
Please eliminate the inconsistencies and move the comment up before the method.
…eview Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Thanks @thomasjoerg for the review. The PR has been updated with code comment moved to the top and changed to match the implementation. Please take a look and let me know if there are any issues. |
This PR tries to address the issur raised in #41370
where tf.math.acos throws out error with complex input data.
The issue was that in XLA the
Acos
op does not capturethe complex data types.
This PR adds complex support for tf.math.acos in XLA
This PR fixes #41370.
Signed-off-by: Yong Tang yong.tang.github@outlook.com