MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / add_to_graph

Method add_to_graph

tensorflow/python/eager/function.py:1319–1333  ·  view source on GitHub ↗

Registers the function, adds it to the graph g or default graph. Args: g: If specified, registers the function with this graph. Defaults to the current context (either the default graph or the eager context).

(self, g=None)

Source from the content-addressed store, hash-verified

1317 expand_composites=False)
1318
1319 def add_to_graph(self, g=None):
1320 """Registers the function, adds it to the graph g or default graph.
1321
1322 Args:
1323 g: If specified, registers the function with this graph. Defaults to the
1324 current context (either the default graph or the eager context).
1325 """
1326 # If we are not executing eagerly, adds the function to default graph if no
1327 # graph is specified.
1328 # In case of eager execution, function definition gets added to context
1329 # during construction itself.
1330
1331 if not context.executing_eagerly() and not g:
1332 g = ops.get_default_graph()
1333 self._delayed_rewrite_functions.forward.add_to_graph(g)
1334
1335 def add_gradient_functions_to_graph(self, g=None):
1336 """Add forward/backward functions to graph `g` or the current context."""

Callers 15

__init__Method · 0.45
create_new_tf_functionFunction · 0.45
partitioned_callFunction · 0.45
_copy_non_sourceFunction · 0.45
registerFunction · 0.45
reduceMethod · 0.45

Calls 1

executing_eagerlyMethod · 0.80