Skip to content

Conversation

@LiZhaoxing
Copy link
Contributor

Fix the issue #1860 .

Due to my fault of last implementation PR #1507 . :(
The logic of here is wrong.

torch/nn/_functions/thnn/activation.py

         else:
             grad_input = grad_output.masked_fill(input > ctx.threshold, 0)
         return grad_input, None, None, None
And this will cause some innormal value in my application.

The implementation is doing in the opposite way. The implementation should be grad_output.masked_fill(input <= ctx.threshold, 0)

@soumith soumith merged commit 3f6cda8 into pytorch:master Jun 22, 2017
@caogang caogang deleted the fixbug_threshold branch June 23, 2017 00:52
jagadish-amd added a commit to jagadish-amd/pytorch that referenced this pull request Feb 5, 2025
Ported upstream PR

Signed-off-by: Jagadish Krishnamoorthy <[email protected]>
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.

4 participants