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

Function toArrayForTest

tfjs-data/src/iterators/lazy_iterator.ts:194–203  ·  view source on GitHub ↗

* Collect all elements of this dataset into an array with prefetching 100 * elements. This is useful for testing, because the prefetch changes the * order in which the Promises are resolved along the processing pipeline. * This may help expose bugs where results are dependent on the order o

()

Source from the content-addressed store, hash-verified

192 * when the stream is exhausted.
193 */
194 async toArrayForTest(): Promise<T[]> {
195 const stream = this.prefetch(100);
196 const result: T[] = [];
197 let x = await stream.next();
198 while (!x.done) {
199 result.push(x.value);
200 x = await stream.next();
201 }
202 return result;
203 }
204
205 /**
206 * Draw items from the stream until it is exhausted.

Callers

nothing calls this directly

Calls 2

nextMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…