Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
carmocca committed Jan 13, 2023
1 parent 72d5e4b commit 9aa71a2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/pytorch_lightning/callbacks/progress/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,8 @@ def get_metrics(self, trainer, model):

def get_standard_metrics(trainer: "pl.Trainer", pl_module: "pl.LightningModule") -> Dict[str, Union[int, str]]:
r"""
Returns several standard metrics displayed in the progress bar, including the latest loss value,
split index of BPTT (if used) and the version of the experiment when using a logger.
Returns several standard metrics displayed in the progress bar, including the latest loss value (if logged as
``train_loss``), and the version of the experiment when using a logger.
.. code-block::
Expand All @@ -270,10 +270,10 @@ def get_standard_metrics(trainer: "pl.Trainer", pl_module: "pl.LightningModule")
loss_value = None
loss_metric = None

# call .item() only once but store elements without graphs
if trainer.training:
loss_metric = trainer.fit_loop._results.get("training_step.train_loss")
if loss_metric is not None:
# call .item() only once but store elements without graphs
loss_value = loss_metric.value.cpu().item()
elif pl_module.automatic_optimization:
loss_value = float("NaN")
Expand Down

0 comments on commit 9aa71a2

Please sign in to comment.