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

Function forEachAsync

tfjs-data/src/dataset.ts:246–248  ·  view source on GitHub ↗

* Apply a function to every element of the dataset. * * After the function is applied to a dataset element, any Tensors contained * within that element are disposed. * * ```js * const a = tf.data.array([1, 2, 3]); * await a.forEachAsync(e => console.log(e)); * ``` * * @

(f: (input: T) => void)

Source from the content-addressed store, hash-verified

244 * @doc {heading: 'Data', subheading: 'Classes'}
245 */
246 async forEachAsync(f: (input: T) => void): Promise<void> {
247 return (await this.iterator()).forEachAsync(f);
248 }
249
250 /**
251 * Maps this dataset through a 1-to-1 transform.

Callers

nothing calls this directly

Calls 1

iteratorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…