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

Function makeIterator

tfjs-data/src/dataset_test.ts:222–232  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

220 async () => {
221 try {
222 const makeIterator = () => {
223 let count = 0;
224 return {
225 next: () => {
226 if (count > 2) {
227 throw new Error('propagate me!');
228 }
229 return {value: count++, done: false};
230 }
231 };
232 };
233 const a = tfd.generator(makeIterator);
234 const b = tfd.array([3, 4, 5, 6]);
235 // Using toArray() rather than toArrayForTest(). The prefetch in

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…