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 1ab4701
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/lightning_fabric/utilities/seed.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def _collect_rng_states() -> Dict[str, Any]:
"""Collect the global random state of :mod:`torch`, :mod:`torch.cuda`, :mod:`numpy` and Python."""
return {
"torch": torch.get_rng_state(),
"torch.cuda": torch.cuda.get_rng_state_all(),
# "torch.cuda": torch.cuda.get_rng_state_all(),
"numpy": np.random.get_state(),
"python": python_get_rng_state(),
}
Expand Down
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 1ab4701

Please sign in to comment.