MCPcopy
hub / github.com/tensorflow/tfjs / serialNext

Method serialNext

tfjs-data/src/iterators/lazy_iterator.ts:647–660  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

645 }
646
647 private async serialNext(): Promise<IteratorResult<T[]>> {
648 const batch: T[] = [];
649 while (batch.length < this.batchSize) {
650 const item = await this.upstream.next();
651 if (item.done) {
652 if (this.enableSmallLastBatch && batch.length > 0) {
653 return {value: batch, done: false};
654 }
655 return {value: null, done: true};
656 }
657 batch.push(item.value);
658 }
659 return {value: batch, done: false};
660 }
661}
662
663class FilterIterator<T> extends LazyIterator<T> {

Callers 1

nextMethod · 0.95

Calls 2

nextMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected