code
stringlengths
3
6.57k
len(iterable)
__len__(self)
__iter__(self)
__next__(self)
next(self.itr)
has_next(self)
len(self)
skip(self, num_to_skip)
next(itertools.islice(self.itr, num_to_skip, num_to_skip)
take(self, n)
min(self.total, n)
len(iterable)
max(n - self.n, 0)
hasattr(self.iterable, "take")
self.iterable.take(propagated_take)
itertools.islice(self.iterable, propagated_take)
EpochBatchIterating(object)
__len__(self)
next_epoch_idx(self)
next_epoch_itr(self, shuffle=True, fix_batches_to_gpus=False)
shuffle (bool, optional)
iterator (default: True)
prefetching (default: False)
end_of_epoch(self)
iterations_in_epoch(self)
state_dict(self)
load_state_dict(self, state_dict)
StreamingEpochBatchIterator(EpochBatchIterating)
isinstance(dataset, torch.utils.data.IterableDataset)
max(epoch, 1)
next_epoch_idx(self)
self.end_of_epoch()
next_epoch_itr(self, shuffle=True, fix_batches_to_gpus=False)
self.dataset.set_epoch(self.epoch)
end_of_epoch(self)
self._current_epoch_iterator.has_next()
iterations_in_epoch(self)
state_dict(self)
load_state_dict(self, state_dict)
EpochBatchIterator(EpochBatchIterating)
method (optionally shuffled between epochs)
dataset (~torch.utils.data.Dataset)
collate_fn (callable)
batch_sampler (~torch.utils.data.Sampler or a callable)
iterator (~torch.utils.data.Sampler)
seed (int, optional)
reproducibility (default: 1)
num_shards (int, optional)
shards (default: 1)
shard_id (int, optional)
return (default: 0)
num_workers (int, optional)
process (default: 0)
epoch (int, optional)
from (default: 1)
buffer_size (int, optional)
timeout (int, optional)
negative. (default: ``0``)
isinstance(dataset, torch.utils.data.Dataset)
tuple(batch_sampler)
callable(batch_sampler)
min(buffer_size, 20)
max(epoch, 1)
getattr(dataset, 'supports_prefetch', False)
frozen_batches(self)
tuple(self.batch_sampler(self.dataset, self.epoch)
__len__(self)
int(math.ceil(len(self.frozen_batches)
float(self.num_shards)
n(self)
next_epoch_idx(self)
self.end_of_epoch()
next_epoch_itr(self, shuffle=True, fix_batches_to_gpus=False)
shuffle (bool, optional)
iterator (default: True)
prefetching (default: False)
self.dataset.set_epoch(self.epoch)
callable(self.batch_sampler)
end_of_epoch(self)
self._cur_epoch_itr.has_next()
iterations_in_epoch(self)
state_dict(self)
self.end_of_epoch()
load_state_dict(self, state_dict)
state_dict.get('iterations_in_epoch', 0)
state_dict.get('version', 1)
state_dict.get('shuffle', True)
_get_iterator_for_epoch(self, epoch, shuffle, fix_batches_to_gpus=False, offset=0)
shuffle_batches(batches, seed)
data_utils.numpy_seed(seed)
np.random.shuffle(batches)
shuffle_batches(list(batches)
self.dataset.prefetch([i for s in batches for i in s])
shuffle_batches(batches, self.seed + epoch + self.shard_id)
shuffle_batches(list(self.frozen_batches)
len(batches)
BufferedIterator(self.buffer_size, itr)
CountingIterator(itr, start=offset)
GroupedIterator(CountingIterator)
groups (chunks)