Skip to content

Commit

Permalink
add set_epoch for MpDeviceLoaderWrapper (#3053)
Browse files Browse the repository at this point in the history
* add set_epoch for MpDeviceLoaderWrapper

* fix one over-indented space
  • Loading branch information
hanwen-sun authored Sep 2, 2024
1 parent b07ad2a commit 758d624
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/accelerate/data_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -652,6 +652,10 @@ def __iter__(self):

return super().__iter__()

def set_epoch(self, epoch: int):
if hasattr(self.dataloader, "set_epoch"):
self.dataloader.set_epoch(epoch)

@property
def total_batch_size(self):
return self._loader.total_batch_size
Expand Down

0 comments on commit 758d624

Please sign in to comment.