# tf.executing_eagerly

<br />

|---|---|
| [![](https://www.tensorflow.org/images/tf_logo_32px.png) TensorFlow 2 version](https://www.tensorflow.org/api_docs/python/tf/executing_eagerly) | [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/python/eager/context.py#L1591-L1602) |

Returns True if the current thread has eager execution enabled.

#### View aliases


**Main aliases**

\`tf.contrib.eager.executing_eagerly\`, \`tf.contrib.eager.in_eager_mode\`
**Compat aliases for migration**

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

[`tf.compat.v1.executing_eagerly`](https://www.tensorflow.org/api_docs/python/tf/compat/v1/executing_eagerly), \`tf.compat.v2.executing_eagerly\`

<br />

    tf.executing_eagerly()

Eager execution is typically enabled via
[`tf.compat.v1.enable_eager_execution`](https://www.tensorflow.org/versions/r1.15/api_docs/python/tf/enable_eager_execution), but may also be enabled within the
context of a Python function via tf.contrib.eager.py_func.