-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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 ROC metric for CUDA tensors #2304
Conversation
Previously roc metric (and auroc) errors when passed in CUDA tensors, due to torch.tensor construction without specifying device. This fixes the error by using F.pad instead.
Codecov Report
@@ Coverage Diff @@
## master #2304 +/- ##
======================================
Coverage 88% 88%
======================================
Files 70 70
Lines 5501 5502 +1
======================================
+ Hits 4834 4835 +1
Misses 667 667 |
@tridao thanks a lot for this fix. You are right, this didn't occur, since we don't have tests with GPU tensors. |
Hello @tridao! Thanks for updating this PR. There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻 Comment last updated at 2020-06-23 12:09:52 UTC |
@tridao I also added changes to the tests in your PR. I will resolve the pep8 issues, once these changes are passing :) |
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.
please derive the device from the lightning module or lightning
@williamFalcon this is just for testing the functional interface, where the computation is on the same device as the inputs :) |
This pull request is now in conflict... :( |
it is just for tests, for run on CPU and GPU
What does this PR do?
Previously roc metric (and auroc) errors when passed in CUDA tensors,
due to torch.tensor construction without specifying device.
This fixes the error by using F.pad instead.
Before submitting
PR review
Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in Github issues there's a high chance it will not be merged.
Did you have fun?
Make sure you had fun coding 🙃