# tf_agents.experimental.distributed.ReverbVariableContainer

<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/experimental/distributed/reverb_variable_container.py#L41-L154) |

Distributed in memory tf.Variable store based on Reverb.

#### View aliases


**Main aliases**

[`tf_agents.experimental.distributed.reverb_variable_container.ReverbVariableContainer`](https://www.tensorflow.org/agents/api_docs/python/tf_agents/experimental/distributed/ReverbVariableContainer)

<br />

    tf_agents.experimental.distributed.ReverbVariableContainer(
        server_address: Text, table_names: Iterable[Text] = (DEFAULT_TABLE,)
    )

This is just a client. The server needs to be consructed and held separately.

> [!NOTE]
> **Note:** The container stores nests of variables in dedicated tables in a Reverb server. It is assumed that the server is running, the tables for variable container exist and are configured properly (i.e. it have signature defined and the `max_size=1`).

<br />

<br />

<br />

| ## Args ||
|---|---|
| `server_address` | The address of the Reverb server. |
| `table_names` | Table names. By default, it is assumed that only a single table is used with the name `variables`. Each table assumed to exist in the server, has signature defined, and set the capacity to 1. |

<br />

<br />

<br />

<br />

| ## Raises ||
|---|---|
| `KeyError` | If a table is not defined in the server, but listed in tables. |
| `TypeError` | If no signature is provided for a table. |
| `ValueError` | If the `max_size` of the table corresponding to table_name(s) on the server is not equal to 1. |

<br />

## Methods

### `pull`

[View source](https://github.com/tensorflow/agents/blob/v0.19.0/tf_agents/experimental/distributed/reverb_variable_container.py#L117-L122)

    pull(
        table: Text = DEFAULT_TABLE
    ) -> https://www.tensorflow.org/agents/api_docs/python/tf_agents/typing/types/NestedTensor

Pulls values from a Reverb table and returns them as nested tensors.

### `push`

[View source](https://github.com/tensorflow/agents/blob/v0.19.0/tf_agents/experimental/distributed/reverb_variable_container.py#L85-L115)

    push(
        values: https://www.tensorflow.org/agents/api_docs/python/tf_agents/typing/types/NestedTensor,
        table: Text = DEFAULT_TABLE
    ) -> None

Pushes values into a Reverb table.

<br />

<br />

<br />

| Args ||
|---|---|
| `values` | Nested structure of tensors. |
| `table` | The name of the table. |

<br />

<br />

<br />

<br />

| Raises ||
|---|---|
| `KeyError` | If the table name is not provided during construction time. |
| [`tf.errors.InvalidArgumentError`](https://www.tensorflow.org/api_docs/python/tf/errors/InvalidArgumentError) | If the nested structure of the variable does not match the signature of the table. This includes structural differences (excluding the type differences of sequences in nest), and type differences. |

<br />

### `update`

[View source](https://github.com/tensorflow/agents/blob/v0.19.0/tf_agents/experimental/distributed/reverb_variable_container.py#L124-L139)

    update(
        variables: https://www.tensorflow.org/agents/api_docs/python/tf_agents/typing/types/NestedVariable,
        table: Text = DEFAULT_TABLE
    ) -> None

Updates variables using values pulled from a Reverb table.

<br />

<br />

<br />

| Args ||
|---|---|
| `variables` | Nested structure of variables. |
| `table` | The name of the table. |

<br />

<br />

<br />

<br />

| Raises ||
|---|---|
| `KeyError` | If the table name is not provided during construction time. |
| `ValueError` | If the nested structure of the variable does not match the signature of the table. This includes structural differences (excluding the type differences of sequences in nest), and type differences. |

<br />