Skip to content

Commit 7abd822

Browse files
carmoccarohitgr7Borda
authored
Add note about returning None (#5578)
Co-authored-by: Rohit Gupta <[email protected]> Co-authored-by: Jirka Borovec <[email protected]> Co-authored-by: Rohit Gupta <[email protected]>
1 parent f477c2f commit 7abd822

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

pytorch_lightning/core/lightning.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -463,8 +463,11 @@ def training_step(self, *args, **kwargs):
463463
Any of.
464464
465465
- :class:`~torch.Tensor` - The loss tensor
466-
- `dict` - A dictionary. Can include any keys, but must include the key 'loss'
467-
- `None` - Training will skip to the next batch
466+
- ``dict`` - A dictionary. Can include any keys, but must include the key ``'loss'``
467+
- ``None`` - Training will skip to the next batch
468+
469+
Note:
470+
Returning ``None`` is currently not supported for multi-GPU or TPU, or with 16-bit precision enabled.
468471
469472
In this step you'd normally do the forward pass and calculate the loss for a batch.
470473
You can also do fancier things like multiple forward passes or something model specific.
@@ -639,7 +642,7 @@ def validation_step(self, *args, **kwargs):
639642
Any of.
640643
641644
- Any object or value
642-
- `None` - Validation will skip to the next batch
645+
- ``None`` - Validation will skip to the next batch
643646
644647
.. code-block:: python
645648
@@ -824,7 +827,7 @@ def test_step(self, *args, **kwargs):
824827
Any of.
825828
826829
- Any object or value
827-
- `None` - Testing will skip to the next batch
830+
- ``None`` - Testing will skip to the next batch
828831
829832
.. code-block:: python
830833

0 commit comments

Comments
 (0)