-
Notifications
You must be signed in to change notification settings - Fork 5.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
tanh_double_grad_rules #52192
tanh_double_grad_rules #52192
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
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.
some commments
// tanh grad grad : ddout = (1 - out^2) * ddx, dout = - (dout_old * 2 * out * | ||
// ddx) | ||
if (out_grad) { | ||
auto out_grad_tmp = -1 * grad_out * 2 * out * grad_x_grad; |
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.
optimize this logic using tmp var
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.
one comment
} | ||
|
||
if (grad_out_grad) { | ||
auto grad_out_grad_tmp = (1 - out * out) * grad_x_grad; |
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.
like 137
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
PR types
others
PR changes
others
Describe
Pcard-66975
拆解tanh_double_grad