-
Notifications
You must be signed in to change notification settings - Fork 3.6k
fix mypy typing errors in pytorch_lightning/tuner/lr_finder.py #13513
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 mypy typing errors in pytorch_lightning/tuner/lr_finder.py #13513
Conversation
for more information, see https://pre-commit.ci
akihironitta
left a comment
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.
Thank you for working on this!
for more information, see https://pre-commit.ci
Co-authored-by: Akihiro Nitta <[email protected]>
Co-authored-by: Akihiro Nitta <[email protected]>
|
Sorry for the closing and reopening PR -- most of the checks are stuck with |
That is because as a first-time contributor you need approval from our team to run our CI (which I just approved) |
Co-authored-by: Justus Schock <[email protected]>
Co-authored-by: Justus Schock <[email protected]>
for more information, see https://pre-commit.ci
Co-authored-by: Justus Schock <[email protected]>
…ning-AI#13513) Co-authored-by: Akihiro Nitta <[email protected]> Co-authored-by: Justus Schock <[email protected]>
What does this PR do?
Fixes mypy typing errors in
pytorch_lightning/tuner/lr_finder.pyin #13445.matplotlibhas been moved to the beginning of the file in order to enableplt.Figuretype.schedulerinLRSchedulerConfigis expected to beUnion[_LRScheduler, ReduceLROnPlateau], but both_LinearLRand_ExponentialLRinherit fromtorch.optim.lr_scheduler._LRScheduler.mypywill throwReturn value expectederror when it detects a lonereturn(Return value expected on def f() -> Optional[Type]: with plain return python/mypy#1003), in which case I added# type: ignoreto the line.mypywill throw in an error if a function is assigned to a method (Unable to assign a function a method python/mypy#2427).Union[_LRScheduler, ReduceLROnPlateau]has no attributelr.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 🙃