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

Method add_to_graph

tensorflow/python/framework/function.py:543–561  ·  view source on GitHub ↗

Adds this function into the graph g.

(self, g)

Source from the content-addressed store, hash-verified

541 return hasher.hexdigest()[:8]
542
543 def add_to_graph(self, g):
544 """Adds this function into the graph g."""
545 self._create_definition_if_needed()
546
547 # Adds this function into 'g'.
548 # pylint: disable=protected-access
549 if context.executing_eagerly():
550 context.context().add_function_def(self.definition)
551 else:
552 g._add_function(self)
553 # pylint: enable=protected-access
554
555 # Ensures related sub-routines are defined in 'g', too.
556 for f in self._sub_functions.values():
557 f.add_to_graph(g)
558
559 # Adds its gradient function, too.
560 if self._grad_func:
561 self._grad_func.add_to_graph(g)
562
563 def __call__(self, *args, **kwargs):
564 self.add_to_graph(ops.get_default_graph())

Callers 3

__call__Method · 0.95
_MakeFuncFunction · 0.45

Calls 6

executing_eagerlyMethod · 0.80
add_function_defMethod · 0.80
contextMethod · 0.45
_add_functionMethod · 0.45
valuesMethod · 0.45

Tested by

no test coverage detected