Tensorflow.js tf.data.Dataset class .prefetch() Method
Tensorflow.js is an open-source library developed by Google for running machine learning models and deep learning neural networks in the browser or node environment.
The tf.data.Dataset class .prefetch() function is used to produce a dataset that prefetches the specified elements from this given dataset.
Parameters: This function accepts a parameter which is illustrated below:
- bufferSize: It is an integer value that specifies the number of elements to be prefetched.
Return Value: It returns a dataset of elements.
5 10 15 20
Tensor ['a', 'b'] Tensor ['c', 'd'] Tensor ['e']