Skip to content

Commit

Permalink
try to fix types for cli
Browse files Browse the repository at this point in the history
  • Loading branch information
awaelchli committed Dec 5, 2021
1 parent d71017d commit 33544ef
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pytorch_lightning/utilities/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

import torch
from torch.optim import Optimizer
from torch.optim.lr_scheduler import _LRScheduler as _TorchLRScheduler, ReduceLROnPlateau as TorchReduceLROnPlateau
from torch.utils.data import DataLoader
from torchmetrics import Metric
from typing_extensions import TypedDict
Expand Down Expand Up @@ -48,7 +49,7 @@

# Copied from `torch.optim.lr_scheduler.pyi`
# Missing attributes were added to improve typing
class _LRScheduler:
class _LRScheduler(_TorchLRScheduler):
optimizer: Optimizer

def __init__(self, optimizer: Optimizer, last_epoch: int = ...) -> None:
Expand All @@ -72,7 +73,7 @@ def step(self, epoch: Optional[int] = ...) -> None:

# Copied from `torch.optim.lr_scheduler.pyi`
# Missing attributes were added to improve typing
class ReduceLROnPlateau:
class ReduceLROnPlateau(TorchReduceLROnPlateau):
in_cooldown: bool
optimizer: Optimizer

Expand Down

0 comments on commit 33544ef

Please sign in to comment.