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

Method _add_jump_node

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

Grows the graph by adding a jump node. Jump nodes are added to the current leaf set, and the leaf set becomes empty. If the jump node is the last in a cond section, then it may be added back to the leaf set by a separate mechanism. Args: ast_node: ast.AST guards: Tuple[

(self, ast_node, guards)

Source from the content-addressed store, hash-verified

380 return node
381
382 def _add_jump_node(self, ast_node, guards):
383 """Grows the graph by adding a jump node.
384
385 Jump nodes are added to the current leaf set, and the leaf set becomes
386 empty. If the jump node is the last in a cond section, then it may be added
387 back to the leaf set by a separate mechanism.
388
389 Args:
390 ast_node: ast.AST
391 guards: Tuple[ast.AST, ...], the finally sections active for this node
392 Returns:
393 Node
394 """
395 node = self._add_new_node(ast_node)
396 self.leaves = set()
397 # The guards themselves may not yet be complete, and will be wired later.
398 self.finally_sections[node] = guards
399 return node
400
401 def _connect_jump_to_finally_sections(self, node):
402 """Connects a jump node to the finally sections protecting it."""

Callers 3

add_exit_nodeMethod · 0.95
add_continue_nodeMethod · 0.95
add_error_nodeMethod · 0.95

Calls 1

_add_new_nodeMethod · 0.95

Tested by

no test coverage detected