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

Method visit_For

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

Source from the content-addressed store, hash-verified

800 self.builder.end_statement(node)
801
802 def visit_For(self, node):
803 self.builder.begin_statement(node)
804 self._enter_lexical_scope(node)
805
806 self.builder.enter_section(node)
807
808 # Note: Strictly speaking, this should be node.target + node.iter.
809 # However, the activity analysis accounts for this inconsistency,
810 # so dataflow analysis produces the correct values.
811 self.builder.enter_loop_section(node, node.iter)
812 for stmt in node.body:
813 self.visit(stmt)
814 self.builder.exit_loop_section(node)
815
816 # Note: although the orelse is technically part of the loop node,
817 # they don't count as loop bodies. For example, a break in the loop's
818 # orelse will affect the parent loop, not the current one.
819 self._exit_lexical_scope(node)
820
821 for stmt in node.orelse:
822 self.visit(stmt)
823
824 self.builder.exit_section(node)
825 self.builder.end_statement(node)
826
827 def visit_Break(self, node):
828 self._process_exit_statement(node, gast.While, gast.For)

Callers

nothing calls this directly

Calls 9

_enter_lexical_scopeMethod · 0.95
_exit_lexical_scopeMethod · 0.95
begin_statementMethod · 0.80
enter_sectionMethod · 0.80
enter_loop_sectionMethod · 0.80
exit_loop_sectionMethod · 0.80
exit_sectionMethod · 0.80
end_statementMethod · 0.80
visitMethod · 0.45

Tested by

no test coverage detected