diff --git a/torchdata/stateful_dataloader/sampler.py b/torchdata/stateful_dataloader/sampler.py index 336129190..308ccd7a8 100644 --- a/torchdata/stateful_dataloader/sampler.py +++ b/torchdata/stateful_dataloader/sampler.py @@ -85,7 +85,6 @@ def __next__(self) -> list[int]: return batch except StopIteration: if self.drop_last or len(batch) == 0: - # Reset the iterator for the next epoch raise StopIteration else: return batch