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

Method enter_loop_section

tensorflow/python/autograph/pyct/cfg.py:476–493  ·  view source on GitHub ↗

Enters a loop section. Loop sections define an entry node. The end of the section always flows back to the entry node. These admit continue jump nodes which also flow to the entry node. Args: section_id: Hashable, the same node that will be used in calls to the ast_

(self, section_id, entry_node)

Source from the content-addressed store, hash-verified

474 del self.exits[section_id]
475
476 def enter_loop_section(self, section_id, entry_node):
477 """Enters a loop section.
478
479 Loop sections define an entry node. The end of the section always flows back
480 to the entry node. These admit continue jump nodes which also flow to the
481 entry node.
482
483 Args:
484 section_id: Hashable, the same node that will be used in calls to the
485 ast_node arg passed to add_continue_node
486 entry_node: ast.AST, the entry node into the loop (e.g. the test node
487 for while loops)
488 """
489 assert section_id not in self.section_entry
490 assert section_id not in self.continues
491 self.continues[section_id] = set()
492 node = self.add_ordinary_node(entry_node)
493 self.section_entry[section_id] = node
494
495 def exit_loop_section(self, section_id):
496 """Exits a loop section."""

Callers 2

visit_WhileMethod · 0.80
visit_ForMethod · 0.80

Calls 1

add_ordinary_nodeMethod · 0.95

Tested by

no test coverage detected