Description
I would like to add the ability to specify size of the dataset when creating from a generator function as e.g. const dataset = tf.data.generator(() => {...}, 65000)
, with the resulting dataset having a size of 65000. Currently you can't specify dataset size even if the generator function only runs a maximum of known iterations. The feature is already implemented in the underlying datasetFromIteratorFn
definition so the change is very minimal. I use a generator because a large dataset is handled, but total count of elements is known.
System information
- TensorFlow.js version (you are using): 4.22.0
- Are you willing to contribute it (Yes/No): Yes
Will this change the current api? How?
The feature would add an optional size parameter to the tf.data.generator
function.
Who will benefit with this feature?
Thos who create datasets of known size from generator functions.