-
Notifications
You must be signed in to change notification settings - Fork 21.6k
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
Fix elu backward operation for negative alpha #49272
Conversation
0e7975a
to
fa19fa0
Compare
Hi, Thanks for sending a patch. |
Hi @albanD, thank you for the feedback. According to the example in #47671, we are hitting an issue when alpha is negative for the backward calculation even when the forward was out-of-place. So I updated the PR to check if the alpha is negative OR if the forward was done in-place, and if so then prevent backward calculation. Is this understanding correct? In the leaky relu case it looks like it checks if the slope is negative AND the forward was in-place, which is slightly different. |
I think this only happens because the formula here uses |
I see, thank you for the helpful explanations @albanD! Updated the PR accordingly. |
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.
@H-Huang has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
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.
@H-Huang has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
Let me know when CI is green and this is ready for a final review :) |
d4c1a6e
to
aa50fa1
Compare
@albanD Can you take a look whenever you get the chance? |
211afc3
to
7115db6
Compare
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.
LGTM !
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.
@H-Huang has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
Fixes #47671
Test: