Skip to content

Commit d451af7

Browse files
BordaSkafteNicki
andauthored
Apply suggestions from code review
Co-authored-by: Nicki Skafte Detlefsen <[email protected]>
1 parent fd5cbf1 commit d451af7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/source-pytorch/common/lightning_module.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ Under the hood, Lightning does the following (pseudocode):
287287
288288
if validate_at_some_point:
289289
# capture .training mode of every submodule
290-
capture_training_mode()
290+
training_mode = model.training
291291
292292
# disable grads + batchnorm + dropout
293293
torch.set_grad_enabled(False)
@@ -302,7 +302,7 @@ Under the hood, Lightning does the following (pseudocode):
302302
torch.set_grad_enabled(True)
303303
304304
# restore .training mode of every submodule
305-
restore_training_mode()
305+
model.training = training_mode
306306
307307
You can also run just the validation loop on your validation dataloaders by overriding :meth:`~lightning.pytorch.core.LightningModule.validation_step`
308308
and calling :meth:`~lightning.pytorch.trainer.trainer.Trainer.validate`.

0 commit comments

Comments
 (0)