# tf.nn.rnn_cell.DeviceWrapper

<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#L1188-L1194) |

Operator that ensures an RNNCell runs on a particular device.

#### View aliases


**Main aliases**

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

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

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

<br />

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

<br />

<br />

<br />

| ## Args ||
|---|---|
| `cell` | An instance of `RNNCell`. |
| `device` | A device string or function, for passing to [`tf.device`](https://www.tensorflow.org/versions/r1.15/api_docs/python/tf/device). |
| `**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#L428-L431)

    zero_state(
        batch_size, dtype
    )