Skip to content
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

[Cherry-pick] Fix the nan bug when passing all zero values into clip_by_norm_op. (#30777) #32038

Merged

Conversation

wzzju
Copy link
Contributor

@wzzju wzzju commented Apr 2, 2021

PR types

Bug fixes

PR changes

OPs

Describe

0.0 / 0.0 = -nan
1.0 / 0.0 = inf

As described above, if all input grads are zero, the output of clip_by_norm will be inf or nan. This pr is used to fix this bug.

@paddle-bot-old
Copy link

paddle-bot-old bot commented Apr 2, 2021

Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@lanxianghit lanxianghit merged commit 1f8834a into PaddlePaddle:release/2.0 Apr 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants