# tf.compat.v1.control_flow_v2_enabled

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v2.13.1/tensorflow/python/ops/control_flow_v2_toggles.py#L64-L70) |

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.