MCPcopy Create free account
hub / github.com/tensorflow/tfjs / next

Method next

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

Source from the content-addressed store, hash-verified

1154 }
1155
1156 override async next(): Promise<IteratorResult<T>> {
1157 // This sets this.lastRead to a new Promise right away, as opposed to
1158 // saying `await this.lastRead; this.lastRead = this.serialNext();` which
1159 // would not work because this.nextRead would be updated only after the
1160 // promise resolves.
1161 this.lastRead = this.lastRead.then(() => this.serialNext());
1162 return this.lastRead;
1163 }
1164
1165 private randomInt(max: number) {
1166 return Math.floor(this.random() * max);

Callers

nothing calls this directly

Calls 1

serialNextMethod · 0.95

Tested by

no test coverage detected