Is one dataset created accompanied by default options? If not, how to use the tf.data.Options()? Just dataset = dataset.with_options(options)? Is there anything else to be noticed?
First create a tf.data.options instance. Then set the properties as you wish. For example:
dataset = tf.data.Dataset.range(10000)
options = tf.data.Options()
options.experimental_optimization.apply_default_optimizations = True
options.experimental_threading.private_threadpool_size = 10
dataset = dataset.with_options(options)
For all options available to you
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With