Skip to content

Commit 209d15f

Browse files
committed
typing
1 parent eec1734 commit 209d15f

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/lightning/pytorch/callbacks/lr_monitor.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,8 @@ def _extract_momentum(self, param_group: dict[str, list[float]], name: str, use_
255255
if not self.log_momentum:
256256
return {}
257257

258-
momentum = param_group["betas"][0] if use_betas else param_group.get("momentum", 0)
258+
momentum = param_group["betas"][0] if use_betas else param_group.get("momentum")
259+
momentum = momentum if momentum is not None else 0
259260
self.last_momentum_values[name] = momentum
260261
return {name: momentum}
261262

src/lightning/pytorch/trainer/connectors/logger_connector/result.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def _generate_sync_fn(self) -> None:
9292
fn = self.no_op if self.fn is None or not self.should or self.rank_zero_only else self.fn
9393
# save the function as `_fn` as the meta are being re-created and the object references need to match.
9494
# ignore typing, bad support for `partial`: mypy/issues/1484
95-
self._fn: Callable = partial(fn, reduce_op=self.op, group=self.group) # type: ignore[arg-type,operator,misc]
95+
self._fn: Callable = partial(fn, reduce_op=self.op, group=self.group) # type: ignore[unused-ignore]
9696

9797
@property
9898
def __call__(self) -> Any:

0 commit comments

Comments
 (0)