Skip to content

Commit 077da33

Browse files
0x404lantiga
authored andcommitted
Fix a typo in _ResultCollection class comments (#18534)
(cherry picked from commit 6dd6d73)
1 parent d9d44d8 commit 077da33

File tree

1 file changed

+3
-4
lines changed
  • src/lightning/pytorch/trainer/connectors/logger_connector

1 file changed

+3
-4
lines changed

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -302,13 +302,12 @@ class _ResultCollection(dict):
302302
"""Collection (dictionary) of
303303
:class:`~lightning.pytorch.trainer.connectors.logger_connector.result._ResultMetric`
304304
305-
Example:
306-
307-
# `device` needs to be provided before logging
308-
result = _ResultCollection(training=True, torch.device("cpu"))
305+
Example::
309306
310307
# you can log to a specific collection.
311308
# arguments: fx, key, value, metadata
309+
310+
result = _ResultCollection(training=True)
312311
result.log('training_step', 'acc', torch.tensor(...), on_step=True, on_epoch=True)
313312
result.log('validation_step', 'recall', torch.tensor(...), on_step=True, on_epoch=True)
314313
"""

0 commit comments

Comments
 (0)