tf.data.experimental.OptimizationOptions

Represents options for dataset optimizations.

You can set the optimization options of a dataset through the experimental_optimization property of tf.data.Options; the property is an instance of tf.data.experimental.OptimizationOptions.

options = tf.data.Options()
options.experimental_optimization.noop_elimination = True
options.experimental_optimization.map_vectorization.enabled = True
options.experimental_optimization.apply_default_optimizations = False
dataset = dataset.with_options(options)

apply_default_optimizations Whether to apply default graph optimizations. If False, only graph optimizations that have been explicitly enabled will be applied.
autotune Whether to automatically tune performance knobs. If None, defaults to True.
autotune_buffers When autotuning is enabled (through autotune), determines whether to also autotune buffer sizes for datasets with parallelism. If None, defaults to False.
autotune_cpu_budget When autotuning is enabled (through autotune), determines the CPU budget to use. Values greater than the number of schedulable CPU cores are allowed but may result in CPU contention. If None, defaults to the number of schedulable CPU cores.
autotune_ram_budget When autotuning is enabled (through autotune), determines the RAM budget to use. Values greater than the available RAM in bytes may result in OOM. If None, defaults to half of the available RAM in bytes.
filter_fusion Whether to fuse filter transformations. If None, defaults to False.
filter_with_random_uniform_fusion Whether to fuse filter dataset that predicts random_uniform < rate into a sampling dataset. If None, defau