tf.nn.RNNCellDeviceWrapper
Stay organized with collections
Save and categorize content based on your preferences.
Operator that ensures an RNNCell runs on a particular device.
Inherits From: AbstractRNNCell
, Layer
, Module
tf.nn.RNNCellDeviceWrapper(
*args, **kwargs
)
Args |
cell
|
An instance of RNNCell .
|
device
|
A device string or function, for passing to tf.device .
|
**kwargs
|
dict of keyword arguments for base layer.
|
Attributes |
output_size
|
|
state_size
|
|
Methods
get_initial_state
View source
get_initial_state(
inputs=None, batch_size=None, dtype=None
)
zero_state
View source
zero_state(
batch_size, dtype
)
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates. Some content is licensed under the numpy license.
Last updated 2021-02-18 UTC.
[null,null,["Last updated 2021-02-18 UTC."],[],[],null,["# tf.nn.RNNCellDeviceWrapper\n\n\u003cbr /\u003e\n\n|-----------------------------------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v2.4.0/tensorflow/python/keras/layers/rnn_cell_wrapper_v2.py#L124-L131) |\n\nOperator that ensures an RNNCell runs on a particular device.\n\nInherits From: [`AbstractRNNCell`](../../tf/keras/layers/AbstractRNNCell), [`Layer`](../../tf/keras/layers/Layer), [`Module`](../../tf/Module) \n\n tf.nn.RNNCellDeviceWrapper(\n *args, **kwargs\n )\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|------------|-----------------------------------------------------------------------------|\n| `cell` | An instance of `RNNCell`. |\n| `device` | A device string or function, for passing to [`tf.device`](../../tf/device). |\n| `**kwargs` | dict of keyword arguments for base layer. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Attributes ---------- ||\n|---------------|---------------|\n| `output_size` | \u003cbr /\u003e \u003cbr /\u003e |\n| `state_size` | \u003cbr /\u003e \u003cbr /\u003e |\n\n\u003cbr /\u003e\n\nMethods\n-------\n\n### `get_initial_state`\n\n[View source](https://github.com/tensorflow/tensorflow/blob/v2.4.0/tensorflow/python/keras/layers/recurrent.py#L1082-L1083) \n\n get_initial_state(\n inputs=None, batch_size=None, dtype=None\n )\n\n### `zero_state`\n\n[View source](https://github.com/tensorflow/tensorflow/blob/v2.4.0/tensorflow/python/keras/layers/legacy_rnn/rnn_cell_wrapper_impl.py#L435-L438) \n\n zero_state(\n batch_size, dtype\n )"]]