<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/framework/ops.py#L4995-L5013) |

Disables eager execution.

    tf.compat.v1.disable_eager_execution() -> None

<br />

## Migrate to TF2

<br />

> [!CAUTION]
> **Caution:** This API was designed for TensorFlow v1. Continue reading for details on how to migrate from this API to a native TensorFlow v2 equivalent. See the [TensorFlow v1 to TensorFlow v2 migration guide](https://www.tensorflow.org/guide/migrate) for instructions on how to migrate the rest of your code.

This function is not necessary if you are using TF2. Eager execution is
enabled by default. If you want to use Graph mode please consider
[tf.function](https://www.tensorflow.org/api_docs/python/tf/function).

<br />

<br />

## Description

### Used in the notebooks

| Used in the tutorials |
|---|
| - [Multi-worker training with Estimator](https://www.tensorflow.org/tutorials/distribute/multi_worker_with_estimator) - [Exploring the TF-Hub CORD-19 Swivel Embeddings](https://www.tensorflow.org/hub/tutorials/cord_19_embeddings) - [Wiki40B Language Models](https://www.tensorflow.org/hub/tutorials/wiki40b_lm) |

This function can only be called before any Graphs, Ops, or Tensors have been
created.