Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically check DataModule.has_{setup,teardown,prepare_data} [2/2] #7238

Merged
merged 16 commits into from
May 11, 2021
Merged
Prev Previous commit
Next Next commit
Bad merge
carmocca committed May 4, 2021
commit acdc61b1347efffd8707407203ebc748b844790e
10 changes: 5 additions & 5 deletions pytorch_lightning/trainer/trainer.py
Original file line number Diff line number Diff line change
@@ -1156,8 +1156,8 @@ def call_setup_hook(self, model: LightningModule) -> None:

if self.datamodule is not None:
self.datamodule.setup(stage=fn)
self.setup(model, stage=state)
model.setup(stage=state)
self.setup(model, stage=fn)
model.setup(stage=fn)

self.accelerator.barrier("post_setup")

@@ -1179,9 +1179,9 @@ def call_teardown_hook(self, model: LightningModule) -> None:

if self.datamodule is not None:
self.datamodule.teardown(stage=fn)
self.profiler.teardown(stage=state)
self.teardown(stage=state)
model.teardown(stage=state)
self.profiler.teardown(stage=fn)
self.teardown(stage=fn)
model.teardown(stage=fn)

model._current_fx_name = ""
model._current_hook_fx_name = None