|View source on GitHub|
Make a template, optionally compiling func_ into a graph function.
tf.contrib.eager.make_template( name_, func_, create_scope_now_=False, unique_name_=None, custom_getter_=None, create_graph_function_=False, **kwargs )
make_template for full documentation.
name_: A name for the scope created by this template. If necessary, the name will be made unique by appending
_Nto the name.
func_: The function to wrap.
create_scope_now_: Boolean controlling whether the scope should be created when the template is constructed or when the template is called. Default is False, meaning the scope is created when the template is called.
unique_name_: When used, it overrides name_ and is not made unique. If a template of the same scope/unique_name already exists and reuse is false, an error is raised. Defaults to None. If executing eagerly, must be None.
custom_getter_: Optional custom getter for variables used in
func_. See the
custom_getterdocumentation for more information.
create_graph_function_: When True,
func_will be executed as a graph function. This implies that
func_must satisfy the properties that
function.defunrequires of functions: See the documentation of
function.defunfor details. When executing eagerly, setting this flag to True can improve performance. Regardless of whether eager execution is enabled, enabling this flag gives the caller access to graph-function semantics, i.e., accesses to variables are totally ordered and side-effecting ops are not pruned.
**kwargs: Keyword arguments to apply to
A function to encapsulate a set of variables which should be created once
and reused. An enclosing scope will be created either when
is called or when the result is called, depending on the value of
create_scope_now_. Regardless of the value, the first time the template
is called it will enter the scope with no reuse, and call
func_ to create
variables, which are guaranteed to be unique. All subsequent calls will
re-enter the scope and reuse those variables.
unique_name_is not None and eager execution is enabled.