<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/ops/control_flow_v2_toggles.py#L63-L69) |

Returns `True` if v2 control flow is enabled.

    tf.compat.v1.control_flow_v2_enabled()

> [!NOTE]
> **Note:** v2 control flow is always enabled inside of tf.function.