We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3627c5b commit 531a826Copy full SHA for 531a826
src/lightning/pytorch/cli.py
@@ -389,6 +389,7 @@ def __init__(
389
self._add_instantiators()
390
self.before_instantiate_classes()
391
self.instantiate_classes()
392
+ self.after_instantiate_classes()
393
394
if self.subcommand is not None:
395
self._run_subcommand(self.subcommand)
@@ -560,6 +561,9 @@ def instantiate_classes(self) -> None:
560
561
self._add_configure_optimizers_method_to_model(self.subcommand)
562
self.trainer = self.instantiate_trainer()
563
564
+ def after_instantiate_classes(self) -> None:
565
+ """Implement to run some code after instantiating the classes."""
566
+
567
def instantiate_trainer(self, **kwargs: Any) -> Trainer:
568
"""Instantiates the trainer.
569
0 commit comments