Aliases:
tf.contrib.rnn.static_state_saving_rnn
tf.nn.static_state_saving_rnn
tf.nn.static_state_saving_rnn(
cell,
inputs,
state_saver,
state_name,
sequence_length=None,
scope=None
)
Defined in tensorflow/python/ops/rnn.py
.
RNN that accepts a state saver for time-truncated RNN calculation.
Args:
cell
: An instance ofRNNCell
.inputs
: A length T list of inputs, each aTensor
of shape[batch_size, input_size]
.state_saver
: A state saver object with methodsstate
andsave_state
.state_name
: Python string or tuple of strings. The name to use with the state_saver. If the cell returns tuples of states (i.e.,cell.state_size
is a tuple) thenstate_name
should be a tuple of strings having the same length ascell.state_size
. Otherwise it should be a single string.sequence_length
: (optional) An int32/int64 vector size [batch_size]. See the documentation for rnn() for more details about sequence_length.scope
: VariableScope for the created subgraph; defaults to "rnn".
Returns:
A pair (outputs, state) where: outputs is a length T list of outputs (one for each input) states is the final state
Raises:
TypeError
: Ifcell
is not an instance of RNNCell.ValueError
: Ifinputs
isNone
or an empty list, or if the arity and type ofstate_name
does not match that ofcell.state_size
.