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

Fix ROC metric for CUDA tensors #2304

Merged
merged 9 commits into from
Jun 23, 2020
Merged

Conversation

tridao
Copy link
Contributor

@tridao tridao commented Jun 20, 2020

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

  • Was this discussed/approved via a Github issue? (no need for typos and docs improvements)
  • [X ] Did you read the contributor guideline, Pull Request section?
  • Did you make sure your PR does only one thing, instead of bundling different changes together? Otherwise, we ask you create a separate PR for every change.
  • Did you make sure to update the documentation with your changes?
  • Did you write any new necessary tests?
  • Did you verify new and existing tests pass locally with your changes?
  • If you made a notable change (that affects users), did you update the CHANGELOG?

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 🙃

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.
@mergify mergify bot requested a review from a team June 20, 2020 20:50
@codecov
Copy link

codecov bot commented Jun 20, 2020

Codecov Report

Merging #2304 into master will increase coverage by 0%.
The diff coverage is 100%.

@@          Coverage Diff           @@
##           master   #2304   +/-   ##
======================================
  Coverage      88%     88%           
======================================
  Files          70      70           
  Lines        5501    5502    +1     
======================================
+ Hits         4834    4835    +1     
  Misses        667     667           

@mergify mergify bot requested a review from a team June 21, 2020 12:19
@justusschock
Copy link
Member

@tridao thanks a lot for this fix. You are right, this didn't occur, since we don't have tests with GPU tensors.

@pep8speaks
Copy link

pep8speaks commented Jun 21, 2020

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

@justusschock
Copy link
Member

@tridao I also added changes to the tests in your PR. I will resolve the pep8 issues, once these changes are passing :)

@Borda Borda added the bug Something isn't working label Jun 21, 2020
@mergify mergify bot requested a review from a team June 21, 2020 12:40
@mergify mergify bot requested a review from a team June 21, 2020 12:42
@mergify mergify bot requested a review from a team June 21, 2020 12:44
@Borda Borda added the ready PRs ready to be merged label Jun 21, 2020
@mergify mergify bot requested a review from a team June 21, 2020 19:53
Copy link
Contributor

@williamFalcon williamFalcon left a 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

@mergify mergify bot requested a review from a team June 21, 2020 19:54
@justusschock
Copy link
Member

@williamFalcon this is just for testing the functional interface, where the computation is on the same device as the inputs :)

@Borda Borda requested a review from williamFalcon June 22, 2020 06:52
@mergify
Copy link
Contributor

mergify bot commented Jun 23, 2020

This pull request is now in conflict... :(

@Borda Borda dismissed williamFalcon’s stale review June 23, 2020 13:18

it is just for tests, for run on CPU and GPU

@Borda Borda merged commit 29179db into Lightning-AI:master Jun 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ready PRs ready to be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants