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

Method visit_FunctionDef

tensorflow/python/autograph/pyct/cfg.py:694–716  ·  view source on GitHub ↗
(self, node)

Source from the content-addressed store, hash-verified

692 self.builder = self.builder_stack.pop()
693
694 def visit_FunctionDef(self, node):
695 # We also keep the FunctionDef node in the CFG. This allows us to determine
696 # things like reaching definitions via closure. Note that the function body
697 # will be stored in a separate graph, because function definitions are not
698 # the same as function calls.
699 if self.builder is not None:
700 self.builder.add_ordinary_node(node)
701
702 self.builder_stack.append(self.builder)
703 self.builder = GraphBuilder(node)
704
705 self._enter_lexical_scope(node)
706 self.builder.enter_section(node)
707
708 self._process_basic_statement(node.args)
709 for stmt in node.body:
710 self.visit(stmt)
711
712 self.builder.exit_section(node)
713 self._exit_lexical_scope(node)
714
715 self.cfgs[node] = self.builder.build()
716 self.builder = self.builder_stack.pop()
717
718 def visit_Return(self, node):
719 self._process_exit_statement(node, gast.FunctionDef)

Callers

nothing calls this directly

Calls 11

_enter_lexical_scopeMethod · 0.95
_exit_lexical_scopeMethod · 0.95
add_ordinary_nodeMethod · 0.80
enter_sectionMethod · 0.80
exit_sectionMethod · 0.80
GraphBuilderClass · 0.70
buildMethod · 0.65
appendMethod · 0.45
visitMethod · 0.45
popMethod · 0.45

Tested by

no test coverage detected