Merged
Conversation
…htning-opt-typing
Contributor
|
Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id> |
Codecov Report
@@ Coverage Diff @@
## master #9990 +/- ##
=======================================
- Coverage 93% 89% -4%
=======================================
Files 179 179
Lines 15822 15815 -7
=======================================
- Hits 14660 14031 -629
- Misses 1162 1784 +622 |
kaushikb11
approved these changes
Oct 18, 2021
rohitgr7
approved these changes
Oct 18, 2021
justusschock
approved these changes
Oct 18, 2021
awaelchli
approved these changes
Oct 18, 2021
rohitgr7
pushed a commit
to Tshimanga/pytorch-lightning
that referenced
this pull request
Oct 18, 2021
kandluis
reviewed
Oct 20, 2021
| ... | ||
|
|
||
| @overload | ||
| def optimizers(self, use_pl_optimizer: Literal[False]) -> Union[Optimizer, List[Optimizer]]: |
Contributor
There was a problem hiding this comment.
I believe we need to add a third overload here for this to work as expected.
Eg.
@overload
def optimizer(self, use_pl_optimizer: bool) -> Union[...]
See the error that is raised as currently written here: https://mypy-play.net/?mypy=latest&python=3.8&gist=183e84ea2331260b77cf58c0bfbf1151
Contributor
Author
There was a problem hiding this comment.
You are correct, this only works if True or False are explicitly passed.
I'll open a PR with the fix.
8 tasks
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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?
Part of #7037
Also some docs changes
Does your PR introduce any breaking changes? If yes, please list them.
None
Before submitting
PR review