tensorflow / tfjs

A WebGL accelerated JavaScript library for training and deploying ML models.
https://js.tensorflow.org
Apache License 2.0
18.51k stars 1.93k forks source link

[tfjs-data] support async generator #8408

Closed tharvik closed 1 month ago

tharvik commented 1 month ago

tf.data.generator accepts function returning an iterator, or a promise of an iterator, which disallow async generator (which returns not a promise of an iterator but an iterator of promises). it is in fact already supported to pass it an async generator, as iteratorFromFunction works with an iterator function returning promises.

this PR simply adds it as a supported type (and rework the documentation a bit).

related issue #7801

mattsoulanille commented 1 month ago

/gcbrun