Skip to content

Commit

Permalink
Revert breaking change in configure_optimizers return type
Browse files Browse the repository at this point in the history
  • Loading branch information
lantiga committed Dec 20, 2024
1 parent c45c3c9 commit cd406cd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions docs/source-pytorch/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -464,8 +464,8 @@ def _load_py_module(name: str, location: str) -> ModuleType:
("py:func", "lightning.pytorch.utilities.rank_zero.rank_zero_only"),
("py:class", "lightning.pytorch.utilities.types.LRSchedulerConfig"),
("py:class", "lightning.pytorch.utilities.types.LRSchedulerConfigType"),
("py:class", "lightning.pytorch.utilities.types.OptimizerConfigType"),
("py:class", "lightning.pytorch.utilities.types.OptimizerLRSchedulerConfigType"),
("py:class", "lightning.pytorch.utilities.types.OptimizerConfig"),
("py:class", "lightning.pytorch.utilities.types.OptimizerLRSchedulerConfig"),
("py:class", "lightning_habana.pytorch.plugins.precision.HPUPrecisionPlugin"),
("py:class", "lightning_habana.pytorch.strategies.HPUDDPStrategy"),
("py:class", "lightning_habana.pytorch.strategies.HPUParallelStrategy"),
Expand Down
12 changes: 6 additions & 6 deletions src/lightning/pytorch/utilities/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,11 @@ class LRSchedulerConfigType(TypedDict, total=False):
strict: bool


class OptimizerConfigType(TypedDict):
class OptimizerConfig(TypedDict):
optimizer: Optimizer


class OptimizerLRSchedulerConfigType(TypedDict):
class OptimizerLRSchedulerConfig(TypedDict):
optimizer: Optimizer
lr_scheduler: Union[LRSchedulerTypeUnion, LRSchedulerConfigType]
monitor: NotRequired[str]
Expand All @@ -119,10 +119,10 @@ class OptimizerLRSchedulerConfigType(TypedDict):
Optimizer,
Sequence[Optimizer],
tuple[Sequence[Optimizer], Sequence[Union[LRSchedulerTypeUnion, LRSchedulerConfig]]],
OptimizerConfigType,
OptimizerLRSchedulerConfigType,
Sequence[OptimizerConfigType],
Sequence[OptimizerLRSchedulerConfigType],
OptimizerConfig,
OptimizerLRSchedulerConfig,
Sequence[OptimizerConfig],
Sequence[OptimizerLRSchedulerConfig],
]
]

Expand Down

0 comments on commit cd406cd

Please sign in to comment.