tf.data.Options

View source on GitHub

Represents options for tf.data.Dataset.

tf.data.Options()

An Options object can be, for instance, used to control which static optimizations to apply or whether to use performance modeling to dynamically tune the parallelism of operations such as tf.data.Dataset.map or tf.data.Dataset.interleave.

After constructing an Options object, use dataset.with_options(options) to apply the options to a dataset.

>>> dataset = tf.data.Dataset.range(3)
>>> options = tf.data.Options()
>>> # Set options here.
>>> dataset = dataset.with_options(options)

Attributes:

Methods

__eq__

View source

__eq__(
    other
)

Return self==value.

__ne__

View source

__ne__(
    other
)

Return self!=value.

merge

View source

merge(
    options
)

Merges itself with the given tf.data.Options.

The given tf.data.Options can be merged as long as there does not exist an attribute that is set to different values in self and options.

Args:

Raises:

Returns:

New tf.data.Options() object which is the result of merging self with the input tf.data.Options.