MCPcopy Create free account
hub / github.com/Open-Bee/DataStudio / __next__

Method __next__

datastudio/datasets/data_loader.py:374–391  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

372 return self
373
374 def __next__(self) -> List[Dict]:
375 if self.idx >= len(self.datas):
376 raise StopIteration
377
378 if self.idx + self.real_batch_size > len(self.datas):
379 batch_data = self.datas[self.idx :]
380 self.idx = len(self.datas)
381 else:
382 batch_data = self.datas[self.idx : self.idx + self.real_batch_size]
383 self.idx += self.real_batch_size
384
385 # Update absolute index for checkpoint
386 self.current_abs_idx = self.start_idx + self.idx
387
388 # Load images for this batch on-demand
389 batch_data = self._load_images_for_batch(batch_data)
390
391 return batch_data
392
393 def update_checkpoint(self) -> None:
394 """Update checkpoint with current progress."""

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected