Skip to content

Commit 35bbe17

Browse files
ybrovmanybrovman
andauthored
fix _reset_eval_dataloader() for IterableDataset (Lightning-AI#1560)
* removed if dl from _reset_eval_dataloader() * changed to if dl != None to be more safe * hints from pep8speaks Co-authored-by: ybrovman <ybrovman@ebay.com>
1 parent fc7f591 commit 35bbe17

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pytorch_lightning/trainer/data_loading.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ def _reset_eval_dataloader(self, model: LightningModule, mode: str) -> Tuple[int
219219
' this off for validation and test dataloaders.')
220220

221221
# add samplers
222-
dataloaders = [self.auto_add_sampler(dl, train=False) for dl in dataloaders if dl]
222+
dataloaders = [self.auto_add_sampler(dl, train=False) for dl in dataloaders if dl is not None]
223223

224224
num_batches = 0
225225

0 commit comments

Comments
 (0)