Skip to content
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

Incorrect output of cupy.logaddexp() #5716

Closed
leofang opened this issue Sep 8, 2021 · 1 comment · Fixed by #6172
Closed

Incorrect output of cupy.logaddexp() #5716

leofang opened this issue Sep 8, 2021 · 1 comment · Fixed by #6172
Assignees
Labels
array-api Topic: Array API Standard cat:bug Bugs prio:high

Comments

@leofang
Copy link
Member

leofang commented Sep 8, 2021

For this case, mathematically we should get inf, but CuPy returns nan:

>>> np.logaddexp(np.inf, np.inf)
inf
>>>
>>> cp.logaddexp(np.inf, np.inf)
array(nan)

The reason is in0-in1 gives nan when both are inf, and it propagates all the way out:

'out0 = fmax(in0, in1) + log1p(exp(-fabs(in0 - in1)))',

@leofang
Copy link
Member Author

leofang commented Sep 8, 2021

Note: this relates to the test_indexing.py failure seen in #5698 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
array-api Topic: Array API Standard cat:bug Bugs prio:high
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants