Skip to content

Commit abac98f

Browse files
authored
Merge pull request #1 from farhadrgh/farhadr/predict
any_on_epoch referenced before assignment
2 parents 6b88ddc + 76d44a3 commit abac98f

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/lightning/pytorch/loops/prediction_loop.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,8 +233,7 @@ def _predict_step(
233233

234234
self.batch_progress.increment_ready()
235235

236-
if not using_dataloader_iter:
237-
any_on_epoch = self._store_data_for_prediction_writer(batch_idx, dataloader_idx)
236+
any_on_epoch = self._store_data_for_prediction_writer(batch_idx, dataloader_idx) if not using_dataloader_iter else False
238237

239238
# the `_step` methods don't take a batch_idx when `dataloader_iter` is used, but all other hooks still do,
240239
# so we need different kwargs

0 commit comments

Comments
 (0)