Skip to content

Commit 92d8f31

Browse files
committed
feat: call reset_train_dataloader method instead of setting attribute to None
1 parent fcffdba commit 92d8f31

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pytorch_lightning/tuner/batch_size_scaling.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ def _run_power_scaling(
162162

163163
if changed:
164164
# Force the train dataloader to reset as the batch size has changed
165-
trainer.train_dataloader = None
165+
trainer.reset_train_dataloader(model)
166166
else:
167167
break
168168
return new_size
@@ -197,7 +197,7 @@ def _run_binsearch_scaling(
197197

198198
if changed:
199199
# Force the train dataloader to reset as the batch size has changed
200-
trainer.train_dataloader = None
200+
trainer.reset_train_dataloader(model)
201201
else:
202202
break
203203

0 commit comments

Comments
 (0)