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
Avoid NaN values in torch.cdist backward for p<1 #45720
Conversation
Codecov Report
@@ Coverage Diff @@
## master #45720 +/- ##
==========================================
- Coverage 68.61% 68.53% -0.08%
==========================================
Files 405 409 +4
Lines 52045 52553 +508
==========================================
+ Hits 35710 36018 +308
- Misses 16335 16535 +200
Continue to review full report at Codecov.
|
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.
Looks mostly good.
Added comments inline.
297ccc8
to
476adff
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.
Looks good.
We can think of more "near to zero" optimization in a follow up PR if we want to.
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.
@albanD has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
@alban, we can modify the formula for different cases |
Not all BC-breaking are a nogo. If we change the computed value to be closer to the correct thing, that's an OK thing to do. The main thing is that we should make sure that it does not make other regions significantly worse. |
Fixes #36493