in src/hyperpod_nemo_adapter/collections/data/vision_dataset.py [0:0]
def __iter__(self):
ids = np.argsort(self.lengths, kind="mergesort")
if self.drop_last:
ids = ids[: len(ids) // self.batch_size * self.batch_size]
batches = [ids[i : i + self.batch_size] for i in range(0, len(ids), self.batch_size)]
if self.shuffle:
random.shuffle(batches)
for b in batches:
yield b