-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
fix mypy typing errors in pytorch_lightning/tuner/lr_finder.py #13513
Conversation
for more information, see https://pre-commit.ci
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 <nitta@akihironitta.com>
Co-authored-by: Akihiro Nitta <nitta@akihironitta.com>
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 <12886177+justusschock@users.noreply.github.com>
Co-authored-by: Justus Schock <12886177+justusschock@users.noreply.github.com>
for more information, see https://pre-commit.ci
Co-authored-by: Justus Schock <12886177+justusschock@users.noreply.github.com>
…ning-AI#13513) Co-authored-by: Akihiro Nitta <nitta@akihironitta.com> Co-authored-by: Justus Schock <12886177+justusschock@users.noreply.github.com>
What does this PR do?
Fixes mypy typing errors in
pytorch_lightning/tuner/lr_finder.py
in #13445.matplotlib
has been moved to the beginning of the file in order to enableplt.Figure
type.scheduler
inLRSchedulerConfig
is expected to beUnion[_LRScheduler, ReduceLROnPlateau]
, but both_LinearLR
and_ExponentialLR
inherit fromtorch.optim.lr_scheduler._LRScheduler
.mypy
will throwReturn value expected
error 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: ignore
to the line.mypy
will 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 🙃