Skip to content

Commit d055430

Browse files
jbschirattiakarnachev
authored and
akarnachev
committed
Doc fixes (Lightning-AI#1362)
* Doc fixes from Lightning-AI#1357 (awaelchli's comments) + changelog. * Fix indentation. * Add blank line to fix doc build?
1 parent 4bbcb09 commit d055430

File tree

2 files changed

+15
-11
lines changed

2 files changed

+15
-11
lines changed

pytorch_lightning/core/lightning.py

+14-10
Original file line numberDiff line numberDiff line change
@@ -245,16 +245,18 @@ def training_epoch_end(
245245
for train_batch in train_data:
246246
out = training_step(train_batch)
247247
train_outs.append(out)
248-
training_epoch_end(val_outs)
248+
training_epoch_end(train_outs)
249249
250250
Args:
251251
outputs: List of outputs you defined in training_step, or if there are multiple
252-
dataloaders, a list containing a list of outputs for each dataloader
252+
dataloaders, a list containing a list of outputs for each dataloader
253253
254254
Return:
255-
Dict or OrderedDict (dict): Dict has the following optional keys:
256-
progress_bar -> Dict for progress bar display. Must have only tensors
257-
log -> Dict of metrics to add to logger. Must have only tensors (no images, etc)
255+
Dict or OrderedDict
256+
May contain the following optional keys:
257+
258+
- log (metrics to be added to the logger ; only tensors)
259+
- any metric used in a callback (e.g. early stopping).
258260
259261
.. note:: If this method is not overridden, this won't be called.
260262
@@ -282,7 +284,7 @@ def training_epoch_end(self, outputs):
282284
283285
With multiple dataloaders, `outputs` will be a list of lists. The outer list contains
284286
one entry per dataloader, while the inner list contains the individual outputs of
285-
each validation step for that dataloader.
287+
each training step for that dataloader.
286288
287289
.. code-block:: python
288290
@@ -539,12 +541,14 @@ def validation_epoch_end(
539541
540542
Args:
541543
outputs: List of outputs you defined in validation_step, or if there are multiple
542-
dataloaders, a list containing a list of outputs for each dataloader
544+
dataloaders, a list containing a list of outputs for each dataloader
543545
544546
Return:
545-
Dict or OrderedDict (dict): Dict has the following optional keys:
546-
progress_bar -> Dict for progress bar display. Must have only tensors
547-
log -> Dict of metrics to add to logger. Must have only tensors (no images, etc)
547+
Dict or OrderedDict
548+
May have the following optional keys:
549+
550+
- progress_bar (dict for progress bar display ; only tensors)
551+
- log (dict of metrics to add to logger ; only tensors).
548552
549553
.. note:: If you didn't define a validation_step, this won't be called.
550554

pytorch_lightning/trainer/training_loop.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -826,4 +826,4 @@ def _recursive_detach(in_dict):
826826
out_dict.update({k: v.detach()})
827827
else:
828828
out_dict.update({k: v})
829-
return out_dict
829+
return out_dict

0 commit comments

Comments
 (0)