tfp.experimental.auto_batching.virtual_machine.execute
Stay organized with collections
Save and categorize content based on your preferences.
Executes or stages a complete auto-batching VM program.
tfp.experimental.auto_batching.virtual_machine.execute(
program, args, max_stack_depth, backend, block_code_cache=None
)
Whether this executes or stages computation depends on whether the backend has
an eager or deferred computation model.
The dimensions of the inputs and internal variables are split into
one top batch dimension and an arbitrary number (here E
) event
dimensions. The event rank may be different for different inputs,
outputs, and internal variables.
Args |
program
|
A instructions.Program to execute or stage.
|
args
|
Input values, a list of arrays, each of shape [batch_size,
e1, ..., eE] . The batch size must be the same for all inputs.
The other dimensions must agree with the declared shapes of the
variables they will be stored in, but need not in general be the
same as one another.
|
max_stack_depth
|
Python int . Maximum depth of stack to allocate.
|
backend
|
Object implementing required backend operations.
|
block_code_cache
|
Dict (allows cache to live across calls to vm.execute ,
or None (in which case a dict is created and used per call).
|
Returns |
results
|
A list of the output values. Each returned value is an
array of shape [batch_size, e1, ..., eE] . The results are
returned in the same order as the variables appear in
program.out_vars .
|
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.virtual_machine.execute\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/virtual_machine.py#L34-L108) |\n\nExecutes or stages a complete auto-batching VM program.\n\n#### View aliases\n\n\n**Main aliases**\n\n[`tfp.experimental.auto_batching.frontend.vm.execute`](https://www.tensorflow.org/probability/api_docs/python/tfp/experimental/auto_batching/virtual_machine/execute)\n\n\u003cbr /\u003e\n\n tfp.experimental.auto_batching.virtual_machine.execute(\n program, args, max_stack_depth, backend, block_code_cache=None\n )\n\nWhether this executes or stages computation depends on whether the backend has\nan eager or deferred computation model.\n\nThe dimensions of the inputs and internal variables are split into\none top batch dimension and an arbitrary number (here `E`) event\ndimensions. The event rank may be different for different inputs,\noutputs, and internal variables.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|--------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `program` | A [`instructions.Program`](../../../../tfp/experimental/auto_batching/instructions/Program) to execute or stage. |\n| `args` | Input values, a list of arrays, each of shape `[batch_size, e1, ..., eE]`. The batch size must be the same for all inputs. The other dimensions must agree with the declared shapes of the variables they will be stored in, but need not in general be the same as one another. |\n| `max_stack_depth` | Python `int`. Maximum depth of stack to allocate. |\n| `backend` | Object implementing required backend operations. |\n| `block_code_cache` | Dict (allows cache to live across calls to [`vm.execute`](../../../../tfp/experimental/auto_batching/virtual_machine/execute), or `None` (in which case a dict is created and used per call). |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ------- ||\n|-----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `results` | A list of the output values. Each returned value is an array of shape `[batch_size, e1, ..., eE]`. The results are returned in the same order as the variables appear in `program.out_vars`. |\n\n\u003cbr /\u003e"]]