Skip to content

Commit

Permalink
Fix typing error of torch/optim/lr_scheduler.pyi (#41775)
Browse files Browse the repository at this point in the history
Summary:
* add `_LRScheduler.get_last_lr` type stub.
* remove `CosineAnnealingWarmRestarts.step` because its signature is same with `_LRScheduler`'s.

Pull Request resolved: pytorch/pytorch#41775

Reviewed By: izdeby

Differential Revision: D22649350

Pulled By: vincentqb

fbshipit-source-id: 5355dd062a5af437f4fc153244dda793a2382e7e
  • Loading branch information
Jeong Ukjae authored and facebook-github-bot committed Jul 23, 2020
1 parent 4b4273a commit e831299
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion torch/optim/lr_scheduler.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ class _LRScheduler:
def __init__(self, optimizer: Optimizer, last_epoch: int=...) -> None: ...
def state_dict(self) -> dict: ...
def load_state_dict(self, state_dict: dict) -> None: ...
def get_last_lr(self) -> List[float]: ...
def get_lr(self) -> float: ...
def step(self, epoch: Optional[int]=...) -> None: ...

Expand Down Expand Up @@ -36,4 +37,3 @@ class CyclicLR(_LRScheduler):

class CosineAnnealingWarmRestarts(_LRScheduler):
def __init__(self, optimizer: Optimizer, T_0: int=..., T_mult: int=..., eta_min: int=..., last_epoch: int=...) -> None: ...
def step(self, epoch: Optional[int] = ...) -> None: ...

0 comments on commit e831299

Please sign in to comment.