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

Function serialNext

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

Source from the content-addressed store, hash-verified

863 protected abstract pump(): Promise<boolean>;
864
865 async serialNext(): Promise<IteratorResult<T>> {
866 // Fetch so that the queue contains at least one item if possible.
867 // If the upstream source is exhausted, AND there are no items left in
868 // the output queue, then this stream is also exhausted.
869 while (this.outputQueue.length() === 0) {
870 // TODO(soergel): consider parallel reads.
871 if (!await this.pump()) {
872 return {value: null, done: true};
873 }
874 }
875 return {value: this.outputQueue.shift(), done: false};
876 }
877}
878class FlatmapIterator<I, O> extends OneToManyIterator<O> {
879 constructor(

Callers

nothing calls this directly

Calls 3

lengthMethod · 0.80
shiftMethod · 0.80
pumpMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…