tfp.experimental.auto_batching.instructions.ControlFlowGraph
Stay organized with collections
Save and categorize content based on your preferences.
A control flow graph (CFG).
tfp.experimental.auto_batching.instructions.ControlFlowGraph(
blocks
)
Args |
blocks
|
Python list of Block objects, the content of the CFG.
Any terminator instructions of said Block objects should
refer to other Block s in the same CFG. Otherwise,
downstream passes or staging may fail.
|
Methods
block
View source
block(
index
)
Returns the Block
given by the input index
.
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".
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2023-11-21 UTC.
[null,null,["Last updated 2023-11-21 UTC."],[],[],null,["# tfp.experimental.auto_batching.instructions.ControlFlowGraph\n\n\u003cbr /\u003e\n\n|--------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/probability/blob/v0.23.0/tensorflow_probability/python/experimental/auto_batching/instructions.py#L291-L350) |\n\nA control flow graph (CFG).\n\n#### View aliases\n\n\n**Main aliases**\n\n[`tfp.experimental.auto_batching.frontend.instructions.ControlFlowGraph`](https://www.tensorflow.org/probability/api_docs/python/tfp/experimental/auto_batching/instructions/ControlFlowGraph), [`tfp.experimental.auto_batching.frontend.st.inst.ControlFlowGraph`](https://www.tensorflow.org/probability/api_docs/python/tfp/experimental/auto_batching/instructions/ControlFlowGraph), [`tfp.experimental.auto_batching.frontend.stack.inst.ControlFlowGraph`](https://www.tensorflow.org/probability/api_docs/python/tfp/experimental/auto_batching/instructions/ControlFlowGraph), [`tfp.experimental.auto_batching.stack_optimization.inst.ControlFlowGraph`](https://www.tensorflow.org/probability/api_docs/python/tfp/experimental/auto_batching/instructions/ControlFlowGraph), [`tfp.experimental.auto_batching.stackless.inst.ControlFlowGraph`](https://www.tensorflow.org/probability/api_docs/python/tfp/experimental/auto_batching/instructions/ControlFlowGraph)\n\n\u003cbr /\u003e\n\n tfp.experimental.auto_batching.instructions.ControlFlowGraph(\n blocks\n )\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `blocks` | Python list of `Block` objects, the content of the CFG. Any terminator instructions of said `Block` objects should refer to other `Block`s in the same CFG. Otherwise, downstream passes or staging may fail. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Attributes ---------- ||\n|----------|---------------|\n| `blocks` | \u003cbr /\u003e \u003cbr /\u003e |\n\n\u003cbr /\u003e\n\nMethods\n-------\n\n### `block`\n\n[View source](https://github.com/tensorflow/probability/blob/v0.23.0/tensorflow_probability/python/experimental/auto_batching/instructions.py#L315-L324) \n\n block(\n index\n )\n\nReturns the `Block` given by the input `index`.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ||\n|---------|-----------------|\n| `index` | A Python `int`. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ||\n|---------|-------------------------------------------------|\n| `block` | The `Block` at that location in the block list. |\n\n\u003cbr /\u003e\n\n### `block_index`\n\n[View source](https://github.com/tensorflow/probability/blob/v0.23.0/tensorflow_probability/python/experimental/auto_batching/instructions.py#L326-L337) \n\n block_index(\n block\n )\n\nReturns the `int` index of the given `Block`.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ||\n|---------|----------------------------------------------------------|\n| `block` | The block to look up. If `None`, returns the exit index. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ||\n|---------|-------------------------------------------------|\n| `index` | Python `int`, the index of the requested block. |\n\n\u003cbr /\u003e\n\n### `enter_block`\n\n[View source](https://github.com/tensorflow/probability/blob/v0.23.0/tensorflow_probability/python/experimental/auto_batching/instructions.py#L343-L345) \n\n enter_block()\n\nReturns the entry `Block`.\n\n### `exit_index`\n\n[View source](https://github.com/tensorflow/probability/blob/v0.23.0/tensorflow_probability/python/experimental/auto_batching/instructions.py#L339-L341) \n\n exit_index()\n\nReturns the `int` index denoting \"exit this CFG\"."]]