tfp.experimental.auto_batching.instructions.Block
Stay organized with collections
Save and categorize content based on your preferences.
A basic block.
tfp.experimental.auto_batching.instructions.Block(
instructions=None, terminator=None, name=None
)
Args |
instructions
|
A list of PrimOp , PopOp , and FunctionCallOp
instructions to execute in order. Control transfer instructions (that
do not return) are not permitted in this list.
|
terminator
|
A single BranchOp , GotoOp , PushGotoOp or
IndirectGotoOp , indicating how to transfer control out of this basic
block.
|
name
|
An object serving as the name of this Block , for display.
|
Attributes |
label_str
|
A string suitable for referring to this Block in printed output.
|
Methods
assign_instructions
View source
assign_instructions(
instructions
)
Assigns the body instructions
and the terminator
at once.
This is a convenience method, to set a Block
's program content
in one invocation instead of having to assign the instructions
and the terminator
fields separately.
Args |
instructions
|
A non-empty Python list of Op objects. The last one must
be a BranchOp , GotoOp , PushGotoOp , or IndirectGotoOp , and
becomes the terminator . The others, if any, must be PrimOp ,
PopOp , or FunctionCallOp , and become the instructions , in order.
|
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2023-11-21 UTC."],[],[],null,["# tfp.experimental.auto_batching.instructions.Block\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#L353-L430) |\n\nA basic block.\n\n#### View aliases\n\n\n**Main aliases**\n\n[`tfp.experimental.auto_batching.frontend.instructions.Block`](https://www.tensorflow.org/probability/api_docs/python/tfp/experimental/auto_batching/instructions/Block), [`tfp.experimental.auto_batching.frontend.st.inst.Block`](https://www.tensorflow.org/probability/api_docs/python/tfp/experimental/auto_batching/instructions/Block), [`tfp.experimental.auto_batching.frontend.stack.inst.Block`](https://www.tensorflow.org/probability/api_docs/python/tfp/experimental/auto_batching/instructions/Block), [`tfp.experimental.auto_batching.stack_optimization.inst.Block`](https://www.tensorflow.org/probability/api_docs/python/tfp/experimental/auto_batching/instructions/Block), [`tfp.experimental.auto_batching.stackless.inst.Block`](https://www.tensorflow.org/probability/api_docs/python/tfp/experimental/auto_batching/instructions/Block)\n\n\u003cbr /\u003e\n\n tfp.experimental.auto_batching.instructions.Block(\n instructions=None, terminator=None, name=None\n )\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|----------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `instructions` | A list of `PrimOp`, `PopOp`, and `FunctionCallOp` instructions to execute in order. Control transfer instructions (that do not return) are not permitted in this list. |\n| `terminator` | A single `BranchOp`, `GotoOp`, `PushGotoOp` or `IndirectGotoOp`, indicating how to transfer control out of this basic block. |\n| `name` | An object serving as the name of this `Block`, for display. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Attributes ---------- ||\n|-------------|--------------------------------------------------------------------|\n| `label_str` | A string suitable for referring to this `Block` in printed output. |\n\n\u003cbr /\u003e\n\nMethods\n-------\n\n### `assign_instructions`\n\n[View source](https://github.com/tensorflow/probability/blob/v0.23.0/tensorflow_probability/python/experimental/auto_batching/instructions.py#L381-L395) \n\n assign_instructions(\n instructions\n )\n\nAssigns the body `instructions` and the `terminator` at once.\n\nThis is a convenience method, to set a `Block`'s program content\nin one invocation instead of having to assign the `instructions`\nand the `terminator` fields separately.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ||\n|----------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `instructions` | A non-empty Python list of `Op` objects. The last one must be a `BranchOp`, `GotoOp`, `PushGotoOp`, or `IndirectGotoOp`, and becomes the `terminator`. The others, if any, must be `PrimOp`, `PopOp`, or `FunctionCallOp`, and become the `instructions`, in order. |\n\n\u003cbr /\u003e"]]