MCPcopy Index your code
hub / github.com/tensorflow/tfjs / serialNext

Method serialNext

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

Source from the content-addressed store, hash-verified

1171 }
1172
1173 async serialNext(): Promise<IteratorResult<T>> {
1174 // TODO(soergel): consider performance
1175 if (!this.upstreamExhausted) {
1176 this.refill();
1177 }
1178 while (!this.buffer.isEmpty()) {
1179 const chosenIndex = this.chooseIndex();
1180 const result = await this.buffer.shuffleExcise(chosenIndex);
1181 if (result.done) {
1182 this.upstreamExhausted = true;
1183 } else {
1184 this.refill();
1185 return result;
1186 }
1187 }
1188 return {value: null, done: true};
1189 }
1190}

Callers 1

nextMethod · 0.95

Calls 4

chooseIndexMethod · 0.95
refillMethod · 0.80
isEmptyMethod · 0.80
shuffleExciseMethod · 0.80

Tested by

no test coverage detected