# tf_agents.replay_buffers.py_hashed_replay_buffer.FrameBuffer

<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/replay_buffers/py_hashed_replay_buffer.py#L37-L95) |

Saves some frames in a memory efficient way.

    tf_agents.replay_buffers.py_hashed_replay_buffer.FrameBuffer()

Thread safety: cannot add multiple frames in parallel.

## Methods

### `add_frame`

[View source](https://github.com/tensorflow/agents/blob/v0.19.0/tf_agents/replay_buffers/py_hashed_replay_buffer.py#L46-L61)

    add_frame(
        frame
    )

Add a frame to the buffer.

<br />

<br />

<br />

| Args ||
|---|---|
| `frame` | Numpy array. |

<br />

<br />

<br />

<br />

| Returns ||
|---|---|
| A deduplicated frame. ||

<br />

### `clear`

[View source](https://github.com/tensorflow/agents/blob/v0.19.0/tf_agents/replay_buffers/py_hashed_replay_buffer.py#L94-L95)

    clear()

### `compress`

[View source](https://github.com/tensorflow/agents/blob/v0.19.0/tf_agents/replay_buffers/py_hashed_replay_buffer.py#L74-L80)

    compress(
        observation, split_axis=-1
    )

### `decompress`

[View source](https://github.com/tensorflow/agents/blob/v0.19.0/tf_agents/replay_buffers/py_hashed_replay_buffer.py#L82-L84)

    decompress(
        observation, split_axis=-1
    )

### `deserialize`

[View source](https://github.com/tensorflow/agents/blob/v0.19.0/tf_agents/replay_buffers/py_hashed_replay_buffer.py#L70-L72)

    deserialize(
        string_value
    )

Callback for `PythonStateWrapper` to deserialize the array.

### `on_delete`

[View source](https://github.com/tensorflow/agents/blob/v0.19.0/tf_agents/replay_buffers/py_hashed_replay_buffer.py#L86-L92)

    on_delete(
        observation, split_axis=-1
    )

### `serialize`

[View source](https://github.com/tensorflow/agents/blob/v0.19.0/tf_agents/replay_buffers/py_hashed_replay_buffer.py#L66-L68)

    serialize()

Callback for `PythonStateWrapper` to serialize the dictionary.

### `__len__`

[View source](https://github.com/tensorflow/agents/blob/v0.19.0/tf_agents/replay_buffers/py_hashed_replay_buffer.py#L63-L64)

    __len__()