Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use tf.data.Options()?

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?

like image 220
lynn Avatar asked Oct 26 '25 00:10

lynn


1 Answers

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

like image 138
Daniel Braun Avatar answered Oct 29 '25 19:10

Daniel Braun



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!