# tf.control_dependencies

<br />

|---|---|
| [![](https://www.tensorflow.org/images/tf_logo_32px.png) TensorFlow 2 version](https://www.tensorflow.org/api_docs/python/tf/control_dependencies) | [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/python/framework/ops.py#L5225-L5254) |

Wrapper for [`Graph.control_dependencies()`](https://www.tensorflow.org/versions/r1.15/api_docs/python/tf/Graph#control_dependencies) using the default graph.

#### View aliases


**Compat aliases for migration**

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

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

<br />

    tf.control_dependencies(
        control_inputs
    )

See [`tf.Graph.control_dependencies`](https://www.tensorflow.org/versions/r1.15/api_docs/python/tf/Graph#control_dependencies)
for more details.

When eager execution is enabled, any callable object in the `control_inputs`
list will be called.

<br />

<br />

<br />

| ## Args ||
|---|---|
| `control_inputs` | A list of `Operation` or `Tensor` objects which must be executed or computed before running the operations defined in the context. Can also be `None` to clear the control dependencies. If eager execution is enabled, any callable object in the `control_inputs` list will be called. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A context manager that specifies control dependencies for all operations constructed within the context. ||

<br />