TF 2.0 is out! Get hands-on practice at TF World, Oct 28-31. Use code TF20 for 20% off select passes. Register now

tfp.experimental.auto_batching.instructions.ControlFlowGraph

View source on GitHub

Class ControlFlowGraph

A control flow graph (CFG).

Aliases:

__init__

View source

__init__(blocks)

A control flow graph (CFG).

A CFG is a set of basic Blocks available in a program. In this system, the Blocks are ordered and indexed to support VM instruction selection, so the CFG also keeps the reverse map from Blocks to their indexes.

Args:

  • blocks: Python list of Block objects, the content of the CFG. Any terminator instructions of said Block objects should refer to other Blocks in the same CFG. Otherwise, downstream passes or staging may fail.

Properties

blocks

Methods

block

View source

block(index)

Returns the Block given by the input index.

Args:

  • index: A Python int.

Returns:

  • block: The Block at that location in the block list.

block_index

View source

block_index(block)

Returns the int index of the given Block.

Args:

  • block: The block to look up. If None, returns the exit index.

Returns:

  • index: Python int, the index of the requested block.

enter_block

View source

enter_block()

Returns the entry Block.

exit_index

View source

exit_index()

Returns the int index denoting "exit this CFG".