We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8ad3e29 commit 0fd3e8aCopy full SHA for 0fd3e8a
src/lightning/pytorch/utilities/data.py
@@ -349,7 +349,14 @@ def _is_dataloader_shuffled(dataloader: object) -> bool:
349
if not hasattr(dataloader, "sampler"):
350
# shuffling is enabled via a sampler. No sampler, no shuffling
351
return False
352
- sampler = dataloader.sampler
+
353
+ batch_sampler = dataloader.batch_sampler
354
+ if batch_sampler is not None:
355
+ # batchsize == 1 case:
356
+ sampler = batch_sampler.sampler
357
+ else:
358
+ sampler = dataloader.sampler
359
360
if isinstance(sampler, SequentialSampler):
361
362
return isinstance(sampler, RandomSampler)
0 commit comments