TF 2.0 is out! Get hands-on practice at TF World, Oct 28-31. Use code TF20 for 20% off select passes. Register now


View source on GitHub

Capture variables created within this scope as Template dependencies.


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-Templates. Where possible, use tf.compat.v1.make_template directly.


  • template: The Template object to register dependencies with.


None (when used as a context manager).