From ad3a5bc92084b9c5c6d5e141eb5ff0029f3fcc78 Mon Sep 17 00:00:00 2001 From: iefgnoix Date: Wed, 13 Dec 2023 09:31:51 -0800 Subject: [PATCH] Fix MpDeviceLoaderWrapper not having attribute batch_sampler (#2242) * Fix MpDeviceLoaderWrapper not having attribute batch_sampler * fix style --- src/accelerate/data_loader.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/accelerate/data_loader.py b/src/accelerate/data_loader.py index 8fd76b3fe56..01a348f82bd 100644 --- a/src/accelerate/data_loader.py +++ b/src/accelerate/data_loader.py @@ -539,6 +539,10 @@ def total_batch_size(self): def total_dataset_length(self): return self._loader.total_dataset_length + @property + def batch_sampler(self): + return self._loader.batch_sampler + class DataLoaderDispatcher(DataLoader, DataLoaderStateMixin): """