tf_agents.utils.common.function
Stay organized with collections
Save and categorize content based on your preferences.
Wrapper for tf.function with TF Agents-specific customizations.
tf_agents.utils.common.function(
*args, **kwargs
)
Used in the notebooks
Example:
@common.function()
def my_eager_code(x, y):
...
Args |
*args
|
Args for tf.function.
|
**kwargs
|
Keyword args for tf.function.
|
Returns |
A tf.function wrapper.
|
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 2024-04-26 UTC.
[null,null,["Last updated 2024-04-26 UTC."],[],[],null,["# tf_agents.utils.common.function\n\n\u003cbr /\u003e\n\n|----------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/agents/blob/v0.19.0/tf_agents/utils/common.py#L129-L151) |\n\nWrapper for tf.function with TF Agents-specific customizations. \n\n tf_agents.utils.common.function(\n *args, **kwargs\n )\n\n### Used in the notebooks\n\n| Used in the tutorials |\n|--------------------------------------------------------------------------------------------------------------------|\n| - [Checkpointer and PolicySaver](https://www.tensorflow.org/agents/tutorials/10_checkpointer_policysaver_tutorial) |\n\n#### Example:\n\n @common.function()\n def my_eager_code(x, y):\n ...\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|------------|-------------------------------|\n| `*args` | Args for tf.function. |\n| `**kwargs` | Keyword args for tf.function. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ------- ||\n|---|---|\n| A tf.function wrapper. ||\n\n\u003cbr /\u003e"]]