Reputation: 143
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?
Upvotes: 4
Views: 1741
Reputation: 2722
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
Upvotes: 4