# tf_agents.utils.common.function

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/agents/blob/v0.19.0/tf_agents/utils/common.py#L129-L151) |

Wrapper for tf.function with TF Agents-specific customizations.

    tf_agents.utils.common.function(
        *args, **kwargs
    )

### Used in the notebooks

| Used in the tutorials |
|---|
| - [Checkpointer and PolicySaver](https://www.tensorflow.org/agents/tutorials/10_checkpointer_policysaver_tutorial) |

#### Example:

    @common.function()
    def my_eager_code(x, y):
      ...

<br />

<br />

<br />

| ## Args ||
|---|---|
| `*args` | Args for tf.function. |
| `**kwargs` | Keyword args for tf.function. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A tf.function wrapper. ||

<br />