Skip to content

Commit ac735db

Browse files
authored
Remove data_pipeline attribute patch (#12204)
1 parent 1f7298d commit ac735db

File tree

2 files changed

+0
-34
lines changed

2 files changed

+0
-34
lines changed

pytorch_lightning/trainer/connectors/data_connector.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -210,10 +210,6 @@ def attach_datamodule(
210210
self.trainer.datamodule = datamodule
211211
datamodule.trainer = self.trainer
212212

213-
# experimental feature for Flash
214-
if hasattr(datamodule, "data_pipeline"):
215-
model.data_pipeline = datamodule.data_pipeline
216-
217213
def _worker_check(self, dataloader: DataLoader, name: str) -> None:
218214
if not isinstance(dataloader, DataLoader):
219215
return

tests/trainer/test_trainer.py

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1721,36 +1721,6 @@ def test_check_val_every_n_epoch_exception(tmpdir):
17211721
Trainer(default_root_dir=tmpdir, max_epochs=1, check_val_every_n_epoch=1.2)
17221722

17231723

1724-
def test_trainer_attach_data_pipeline_to_model(tmpdir):
1725-
class DataPipeline:
1726-
1727-
pass
1728-
1729-
class TestDataModule(LightningDataModule):
1730-
1731-
data_pipeline = DataPipeline()
1732-
1733-
def train_dataloader(self):
1734-
return DataLoader(RandomDataset(32, 64))
1735-
1736-
def val_dataloader(self):
1737-
return DataLoader(RandomDataset(32, 64))
1738-
1739-
def test_dataloader(self):
1740-
return DataLoader(RandomDataset(32, 64))
1741-
1742-
class TestCallback(Callback):
1743-
def on_fit_start(self, trainer, pl_module: LightningModule) -> None:
1744-
"""Called when fit begins."""
1745-
assert isinstance(pl_module.data_pipeline, DataPipeline)
1746-
1747-
model = BoringModel()
1748-
dm = TestDataModule()
1749-
1750-
trainer = Trainer(default_root_dir=tmpdir, max_epochs=1, callbacks=[TestCallback()])
1751-
trainer.fit(model, datamodule=dm)
1752-
1753-
17541724
def test_exception_when_testing_or_validating_with_fast_dev_run():
17551725
trainer = Trainer(fast_dev_run=True)
17561726
trainer.state.fn = TrainerFn.TESTING

0 commit comments

Comments
 (0)