Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Oct 9, 2024
1 parent 0fd3e8a commit 232fe8e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lightning/pytorch/utilities/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,14 +349,14 @@ def _is_dataloader_shuffled(dataloader: object) -> bool:
if not hasattr(dataloader, "sampler"):
# shuffling is enabled via a sampler. No sampler, no shuffling
return False

batch_sampler = dataloader.batch_sampler
if batch_sampler is not None:
# batchsize == 1 case:
sampler = batch_sampler.sampler
else:
sampler = dataloader.sampler

if isinstance(sampler, SequentialSampler):
return False
return isinstance(sampler, RandomSampler)

0 comments on commit 232fe8e

Please sign in to comment.