# tf.contrib.checkpoint.capture_dependencies

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/python/training/tracking/util.py#L519-L607) |

Capture variables created within this scope as `Template` dependencies.

    @tf_contextlib.contextmanager
    tf.contrib.checkpoint.capture_dependencies(
        template
    )

Requires that `template.variable_scope` is active.

This scope is intended as a compatibility measure, allowing a trackable
object to add dependencies on variables created in a block of code which is
not aware of object-based saving (and instead uses variable names
heavily). This is how `Template` objects add dependencies on variables and
sub-`Template`s. Where possible, use [`tf.compat.v1.make_template`](https://www.tensorflow.org/versions/r1.15/api_docs/python/tf/make_template) directly.

<br />

<br />

<br />

| ## Args ||
|---|---|
| `template` | The `Template` object to register dependencies with. |

<br />

#### Yields:

None (when used as a context manager).