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

remove obsolete self._device in Trainer #1849

Merged
merged 3 commits into from
May 17, 2020

Conversation

awaelchli
Copy link
Contributor

@awaelchli awaelchli commented May 16, 2020

Before submitting

  • Was this discussed/approved via a Github issue? (no need for typos and docs improvements)
  • Did you read the contributor guideline, Pull Request section?
  • Did you make sure to update the docs?
  • Did you write any new necessary tests?
  • If you made a notable change (that affects users), did you update the CHANGELOG?

What does this PR do?

Follow up to #1791 which left behind an unused attribute _device in Trainer distrib parts.
It is not needed anymore since the device is now an attribute of LightningModule. Same for on_gpu, which can be determined by device.

Managing these properties in one place makes code less fragile.

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 🙃

@awaelchli awaelchli added the feature Is an improvement or enhancement label May 16, 2020
@mergify mergify bot requested a review from a team May 16, 2020 01:22
@awaelchli awaelchli changed the title remove unused self._device in Trainer remove obsolete self._device in Trainer May 16, 2020
@codecov
Copy link

codecov bot commented May 16, 2020

Codecov Report

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

@@          Coverage Diff           @@
##           master   #1849   +/-   ##
======================================
  Coverage      88%     88%           
======================================
  Files          71      71           
  Lines        4488    4481    -7     
======================================
- Hits         3947    3944    -3     
+ Misses        541     537    -4     

@awaelchli awaelchli requested review from Borda and justusschock May 16, 2020 05:24
@williamFalcon williamFalcon merged commit 4cdebf9 into master May 17, 2020
@awaelchli awaelchli deleted the feature/unused_device_attr branch May 17, 2020 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Is an improvement or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants