I noticed that in the Data Loader class, get_idxs
is written as follows
def get_idxs(self):
idxs = Inf.count if self.indexed else Inf.nones
if self.n is not None: idxs = list(itertools.islice(idxs, self.n))
if self.shuffle: idxs = self.shuffle_fn(idxs)
return idxs
What is the advantage of creating an infinite count of indexes and slicing them instead of using something like range?