Internal API to optionally compile a template's function into a graph function.
(1) Adds a function `make_template_internal` that takes an optional keyword
argument `create_graph_function_` that controls whether or not `func_` is
compiled into and executed as a graph function.
(2) Exposes `make_template_internal` as `tfe.make_template`, so users may
write something like
`
compiled = tfe.make_template("my_op", func, create_graph_function_=True)
`
to obtain a templatized version of func that is executed as a graph
function.
(3) Simplifies the implementation of (Eager)Template's _call_func and __call__
methods in a minor way.
PiperOrigin-RevId: 182082866
Loading
Please sign in to comment