Skip to content

Conversation

@ssnl
Copy link
Collaborator

@ssnl ssnl commented Aug 6, 2018

Fixes #10238

{
T x = *in;
*out = (x > threshold_) ? x : val_;
*out = (x <= threshold_) ? val_ : x; // this order propagates NaN

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

@ssnl
Copy link
Collaborator Author

ssnl commented Aug 7, 2018

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

SsnL has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

Copy link
Contributor

@zou3519 zou3519 left a comment

Choose a reason for hiding this comment

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

I wish there were a nicer approach to catching these cases but LGTM.

zdevito pushed a commit to zdevito/ATen that referenced this pull request Aug 15, 2018
Summary:
Fixes pytorch/pytorch#10238
Pull Request resolved: pytorch/pytorch#10277

Reviewed By: SsnL

Differential Revision: D9199825

Pulled By: soumith

fbshipit-source-id: 8ee7f9a72d9546d429f311c3f6028461d3c93fe2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

nn.ReLU Module with input NaN still gives 0

4 participants