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

Method visit_If

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

Source from the content-addressed store, hash-verified

756 self._process_basic_statement(node)
757
758 def visit_If(self, node):
759 # No need to track ifs as lexical scopes, for now.
760 # Lexical scopes are generally tracked in order to be able to resolve the
761 # targets of jump statements like break/continue/etc. Since there is no
762 # statement that can interrupt a conditional, we don't need to track their
763 # lexical scope. That may change in the future.
764 self.builder.begin_statement(node)
765
766 self.builder.enter_cond_section(node)
767 self._process_basic_statement(node.test)
768
769 self.builder.new_cond_branch(node)
770 for stmt in node.body:
771 self.visit(stmt)
772
773 self.builder.new_cond_branch(node)
774 for stmt in node.orelse:
775 self.visit(stmt)
776
777 self.builder.exit_cond_section(node)
778 self.builder.end_statement(node)
779
780 def visit_While(self, node):
781 self.builder.begin_statement(node)

Callers

nothing calls this directly

Calls 7

begin_statementMethod · 0.80
enter_cond_sectionMethod · 0.80
new_cond_branchMethod · 0.80
exit_cond_sectionMethod · 0.80
end_statementMethod · 0.80
visitMethod · 0.45

Tested by

no test coverage detected