Closed asuiu closed 4 years ago
Example:
def split_in_batches(self, itr: Iterable[T], batch_max_size: int = BATCH_SIZE) -> Generator[slist[T], None, None]: batch = slist() for el in itr: batch.append(el) if batch.size() == batch_max_size: yield batch batch = slist() if batch.size(): yield batch
Implemented in stream.batch(). Covered by tests & used in prod code.
stream.batch()
Example: