<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v2.21.0/tensorflow/python/data/ops/options.py#L534-L576) |

Represents options for dataset threading.

#### View aliases


**Main aliases**

[`tf.data.experimental.ThreadingOptions`](https://www.tensorflow.org/api_docs/python/tf/data/ThreadingOptions)
**Compat aliases for migration**

See
[Migration guide](https://www.tensorflow.org/guide/migrate) for
more details.

[`tf.compat.v1.data.ThreadingOptions`](https://www.tensorflow.org/api_docs/python/tf/data/ThreadingOptions), [`tf.compat.v1.data.experimental.ThreadingOptions`](https://www.tensorflow.org/api_docs/python/tf/data/ThreadingOptions)

<br />

    tf.data.ThreadingOptions()

You can set the threading options of a dataset through the
`threading` property of [`tf.data.Options`](https://www.tensorflow.org/api_docs/python/tf/data/Options); the property is
an instance of [`tf.data.ThreadingOptions`](https://www.tensorflow.org/api_docs/python/tf/data/ThreadingOptions).

    options = tf.data.Options()
    options.threading.private_threadpool_size = 10
    dataset = dataset.with_options(options)

<br />

<br />

<br />

| ## Attributes ||
|---|---|
| `max_intra_op_parallelism` | If set, it overrides the maximum degree of intra-op parallelism. |
| `private_threadpool_size` | If set, the dataset will use a private threadpool of the given size. The value 0 can be used to indicate that the threadpool size should be determined at runtime based on the number of available CPU cores. |

<br />

## Methods

### `__eq__`

[View source](https://github.com/tensorflow/tensorflow/blob/v2.21.0/tensorflow/python/data/util/options.py#L38-L44)

    __eq__(
        other
    )

Return self==value.

### `__ne__`

[View source](https://github.com/tensorflow/tensorflow/blob/v2.21.0/tensorflow/python/data/util/options.py#L46-L50)

    __ne__(
        other
    )

Return self!=value.