Skip to content

Commit 98de69b

Browse files
authored
Fix loop examples after Accelerator API removals (#10514)
1 parent 6dfcb6a commit 98de69b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

pl_examples/loop_examples/kfold.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ def on_run_end(self) -> None:
205205
voting_model = EnsembleVotingModel(type(self.trainer.lightning_module), checkpoint_paths)
206206
voting_model.trainer = self.trainer
207207
# This requires to connect the new model and move it the right device.
208-
self.trainer.accelerator.connect(voting_model)
208+
self.trainer.training_type_plugin.connect(voting_model)
209209
self.trainer.training_type_plugin.model_to_device()
210210
self.trainer.test_loop.run()
211211

pl_examples/loop_examples/yielding_training_step.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def _training_step(self, generator):
8686
# Here, instead of calling `lightning_module.training_step()`
8787
# we call next() on the generator!
8888
training_step_output = next(generator)
89-
self.trainer.accelerator.post_training_step()
89+
self.trainer.training_type_plugin.post_training_step()
9090

9191
training_step_output = self.trainer.call_hook("training_step_end", training_step_output)
9292

0 commit comments

Comments
 (0)