Skip to content

Commit 3c53c92

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent af8259a commit 3c53c92

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

src/lightning/pytorch/callbacks/device_stats_monitor.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,9 @@ class DeviceStatsMonitor(Callback):
158158
159159
"""
160160

161-
def __init__(self, cpu_stats: Optional[bool] = None, filter_keys: Optional[set[str]] = None, verbose: bool = False) -> None:
161+
def __init__(
162+
self, cpu_stats: Optional[bool] = None, filter_keys: Optional[set[str]] = None, verbose: bool = False
163+
) -> None:
162164
self._cpu_stats = cpu_stats
163165
self._filter_keys = filter_keys
164166
self._verbose = verbose
@@ -197,7 +199,6 @@ def setup(
197199
f" {unrecognized}"
198200
)
199201

200-
201202
@staticmethod
202203
def _filter_core_device_stats(stats: dict[str, float]) -> dict[str, float]:
203204
return {

tests/tests_pytorch/callbacks/test_device_stats_monitor.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,7 @@ def log_metrics(self, metrics: dict[str, float], step: Optional[int] = None) ->
323323
)
324324
trainer.fit(model)
325325

326+
326327
@RunIf(psutil=True)
327328
def test_device_stats_monitor_filter_keys_unrecognized_warns(tmp_path):
328329
"""Test that filter_keys emits a warning for keys not present in device stats."""

0 commit comments

Comments
 (0)