Commit e40e4b21 authored by Myle Ott's avatar Myle Ott Committed by Facebook Github Bot
Browse files

Add back set_epoch functionality lost in RoBERTa merge

Summary: Pull Request resolved: https://github.com/pytorch/fairseq/pull/982

Differential Revision: D16668353

Pulled By: myleott

fbshipit-source-id: 699243d6c028c47cd0e3f801d89051b3f919b17e
parent 5d543f9b
......@@ -50,3 +50,6 @@ class FairseqDataset(torch.utils.data.Dataset):
def prefetch(self, indices):
"""Prefetch the data required for this epoch."""
raise NotImplementedError
def set_epoch(self, epoch):
pass
......@@ -179,6 +179,7 @@ class EpochBatchIterator(EpochBatchIterating):
self._cur_epoch_itr = self._get_iterator_for_epoch(
self.epoch, shuffle, fix_batches_to_gpus=fix_batches_to_gpus,
)
self.dataset.set_epoch(self.epoch)
return self._cur_epoch_itr
def end_of_epoch(self) -> bool:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment