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

Method iterator

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

Source from the content-addressed store, hash-verified

275 class CustomDataset extends tfd.Dataset<{}> {
276 state = {val: 1};
277 async iterator() {
278 const result = iteratorFromItems([
279 {'item': this.state.val++}, {'item': this.state.val++},
280 {'item': this.state.val++}
281 ]);
282 return result;
283 }
284 }
285 const a = new CustomDataset();
286 await a.repeat().take(1234).toArrayForTest();

Callers

nothing calls this directly

Calls 1

iteratorFromItemsFunction · 0.90

Tested by

no test coverage detected