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

Function iteratorFromFunction

tfjs-data/src/iterators/lazy_iterator.ts:65–69  ·  view source on GitHub ↗
(
    func: () =>
        IteratorResult<T>| Promise<IteratorResult<T>>)

Source from the content-addressed store, hash-verified

63 * @param func A function that produces data on each call.
64 */
65export function iteratorFromFunction<T>(
66 func: () =>
67 IteratorResult<T>| Promise<IteratorResult<T>>): LazyIterator<T> {
68 return new FunctionCallIterator(func);
69}
70
71/**
72 * Create a `LazyIterator` by concatenating underlying streams, which are

Callers 6

repeatFunction · 0.90
funcFunction · 0.90
generatorFunction · 0.90
iteratorFromIncrementingFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…