Skip to content

Conversation

jheek
Copy link
Contributor

@jheek jheek commented Oct 21, 2019

The gradient of np.where is not robust to NaNs in the unselected branch.
A double where trick makes sure that the expm1 will not NaN.
I have added a check_grads test that NaNs with the original implementation.

@mattjj
Copy link
Collaborator

mattjj commented Oct 22, 2019

See also this comment on #1052 (and #347 and its "fix" #383 that I still plan to roll back) for a discussion.

Copy link
Collaborator

@mattjj mattjj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants