# tf.nn.rnn_cell.ResidualWrapper

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/python/ops/rnn_cell_impl.py#L1177-L1184) |

RNNCell wrapper that ensures cell inputs are added to the outputs.

#### View aliases


**Main aliases**

\`tf.contrib.rnn.ResidualWrapper\`
**Compat aliases for migration**

See
[Migration guide](https://www.tensorflow.org/guide/migrate) for
more details.

[`tf.compat.v1.nn.rnn_cell.ResidualWrapper`](https://www.tensorflow.org/api_docs/python/tf/compat/v1/nn/rnn_cell/ResidualWrapper)

<br />

    tf.nn.rnn_cell.ResidualWrapper(
        *args, **kwargs
    )

<br />

<br />

<br />

| ## Args ||
|---|---|
| `cell` | An instance of `RNNCell`. |
| `residual_fn` | (Optional) The function to map raw cell inputs and raw cell outputs to the actual cell outputs of the residual network. Defaults to calling nest.map_structure on (lambda i, o: i + o), inputs and outputs. |
| `**kwargs` | dict of keyword arguments for base layer. |

<br />

<br />

<br />

<br />

| ## Attributes ||
|---|---|
| `graph` | DEPRECATED FUNCTION <br /> > [!WARNING] > **Warning:** THIS FUNCTION IS DEPRECATED. It will be removed in a future version. Instructions for updating: Stop using this property because tf.layers layers no longer track their graph. |
| `output_size` | <br /> |
| `scope_name` | <br /> <br /> |
| `state_size` | <br /> <br /> |

<br />

## Methods

### `get_initial_state`

[View source](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/python/ops/rnn_cell_impl.py#L281-L309)

    get_initial_state(
        inputs=None, batch_size=None, dtype=None
    )

### `zero_state`

[View source](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/python/ops/rnn_cell_wrapper_impl.py#L344-L346)

    zero_state(
        batch_size, dtype
    )