-
Notifications
You must be signed in to change notification settings - Fork 3.5k
fix mypy typing errors in pytorch_lightning/strategies/strategy.py #13519
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
Merged
otaj
merged 19 commits into
Lightning-AI:master
from
CyprienRicque:tests/13445-strategy_typing
Jul 26, 2022
Merged
fix mypy typing errors in pytorch_lightning/strategies/strategy.py #13519
otaj
merged 19 commits into
Lightning-AI:master
from
CyprienRicque:tests/13445-strategy_typing
Jul 26, 2022
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for more information, see https://pre-commit.ci
…o tests/13445-strategy_typing
52 tasks
awaelchli
reviewed
Jul 4, 2022
Co-authored-by: Adrian Wälchli <[email protected]>
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
awaelchli
approved these changes
Jul 21, 2022
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.
Great work. Allowed myself to make minor cosmetic edits :)
12 tasks
otaj
approved these changes
Jul 25, 2022
Codecov Report
@@ Coverage Diff @@
## master #13519 +/- ##
=========================================
- Coverage 86% 76% -10%
=========================================
Files 330 330
Lines 25941 25971 +30
=========================================
- Hits 22241 19745 -2496
- Misses 3700 6226 +2526 |
rohitgr7
approved these changes
Jul 25, 2022
Borda
reviewed
Jul 26, 2022
Borda
approved these changes
Jul 26, 2022
justusschock
approved these changes
Jul 26, 2022
12 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
code quality
community
This PR is from the community
pl
Generic label for PyTorch Lightning package
ready
PRs ready to be merged
strategy
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Fixes mypy typing errors in pytorch_lightning/strategies/strategy.py in #13445.
model
becomes explicitlyOptional[]
in plugins functions such asoptimizer_step
and_after_closure
self.accelerator
becomes explicitlyOptional[]
in strategy classesself.accelerator
,self.model
andself.lightning_module
is checked in strategy classes usingassert
when neededoutput
intraining_step_end
,validation_step_end
andtest_step_end
has been renamed tostep_output
to stay consistent with other functionsself.model
has to be of typepl.LightningModule
or_LightningPrecisionModuleWrapperBase
to usetraining_step
,validation_step
,test_step
andpredict_step
Does your PR introduce any breaking changes? If yes, please list them.
None
Before submitting
PR review
Anyone in the community is welcome to review the PR.
Before you start reviewing, make sure you have read the review guidelines. In short, see the following bullet-list:
Did you have fun?
Make sure you had fun coding 🙃