diff options
Diffstat (limited to 'tensorflow/g3doc/api_docs')
4 files changed, 90 insertions, 32 deletions
diff --git a/tensorflow/g3doc/api_docs/python/functions_and_classes/shard0/tf.nn.rnn.md b/tensorflow/g3doc/api_docs/python/functions_and_classes/shard0/tf.nn.rnn.md index 115567095f..19caecfb70 100644 --- a/tensorflow/g3doc/api_docs/python/functions_and_classes/shard0/tf.nn.rnn.md +++ b/tensorflow/g3doc/api_docs/python/functions_and_classes/shard0/tf.nn.rnn.md @@ -30,11 +30,11 @@ The dynamic calculation performed is, at time t for batch row b, * <b>`cell`</b>: An instance of RNNCell. -* <b>`inputs`</b>: A length T list of inputs, each a tensor of shape - [batch_size, input_size], or a nested tuple of such elements. +* <b>`inputs`</b>: A length T list of inputs, each a `Tensor` of shape + `[batch_size, input_size]`, or a nested tuple of such elements. * <b>`initial_state`</b>: (optional) An initial state for the RNN. If `cell.state_size` is an integer, this must be - a tensor of appropriate type and shape `[batch_size x cell.state_size]`. + a `Tensor` of appropriate type and shape `[batch_size, cell.state_size]`. If `cell.state_size` is a tuple, this should be a tuple of tensors having shapes `[batch_size, s] for s in cell.state_size`. * <b>`dtype`</b>: (optional) The data type for the initial state and expected output. diff --git a/tensorflow/g3doc/api_docs/python/functions_and_classes/shard5/tf.nn.state_saving_rnn.md b/tensorflow/g3doc/api_docs/python/functions_and_classes/shard5/tf.nn.state_saving_rnn.md index ab6db0eae3..67a444ad4a 100644 --- a/tensorflow/g3doc/api_docs/python/functions_and_classes/shard5/tf.nn.state_saving_rnn.md +++ b/tensorflow/g3doc/api_docs/python/functions_and_classes/shard5/tf.nn.state_saving_rnn.md @@ -6,7 +6,7 @@ RNN that accepts a state saver for time-truncated RNN calculation. * <b>`cell`</b>: An instance of `RNNCell`. -* <b>`inputs`</b>: A length T list of inputs, each a tensor of shape +* <b>`inputs`</b>: A length T list of inputs, each a `Tensor` of shape `[batch_size, input_size]`. * <b>`state_saver`</b>: A state saver object with methods `state` and `save_state`. * <b>`state_name`</b>: Python string or tuple of strings. The name to use with the diff --git a/tensorflow/g3doc/api_docs/python/functions_and_classes/shard8/tf.nn.dynamic_rnn.md b/tensorflow/g3doc/api_docs/python/functions_and_classes/shard8/tf.nn.dynamic_rnn.md index 32ae56a32e..34a275c6a1 100644 --- a/tensorflow/g3doc/api_docs/python/functions_and_classes/shard8/tf.nn.dynamic_rnn.md +++ b/tensorflow/g3doc/api_docs/python/functions_and_classes/shard8/tf.nn.dynamic_rnn.md @@ -5,10 +5,14 @@ Creates a recurrent neural network specified by RNNCell `cell`. This function is functionally identical to the function `rnn` above, but performs fully dynamic unrolling of `inputs`. -Unlike `rnn`, the input `inputs` is not a Python list of `Tensors`. Instead, -it is a single `Tensor` where the maximum time is either the first or second -dimension (see the parameter `time_major`). The corresponding output is -a single `Tensor` having the same number of time steps and batch size. +Unlike `rnn`, the input `inputs` is not a Python list of `Tensors`, one for +each frame. Instead, `inputs` may be a single `Tensor` where +the maximum time is either the first or second dimension (see the parameter +`time_major`). Alternatively, it may be a (possibly nested) tuple of +Tensors, each of them having matching batch and time dimensions. +The corresponding output is either a single `Tensor` having the same number +of time steps and batch size, or a (possibly nested) tuple of such tensors, +matching the nested structure of `cell.output_size`. The parameter `sequence_length` is required and dynamic calculation is automatically performed. @@ -18,16 +22,29 @@ automatically performed. * <b>`cell`</b>: An instance of RNNCell. * <b>`inputs`</b>: The RNN inputs. - If time_major == False (default), this must be a tensor of shape: - `[batch_size, max_time, input_size]`, or a nested tuple of such + + If `time_major == False` (default), this must be a `Tensor` of shape: + `[batch_size, max_time, ...]`, or a nested tuple of such elements. - If time_major == True, this must be a tensor of shape: - `[max_time, batch_size, input_size]`, or a nested tuple of such + + If `time_major == True`, this must be a `Tensor` of shape: + `[max_time, batch_size, ...]`, or a nested tuple of such elements. + + This may also be a (possibly nested) tuple of Tensors satisfying + this property. The first two dimensions must match across all the inputs, + but otherwise the ranks and other shape components may differ. + In this case, input to `cell` at each time-step will replicate the + structure of these tuples, except for the time dimension (from which the + time is taken). + + The input to `cell` at each time step will be a `Tensor` or (possibly + nested) tuple of Tensors each with dimensions `[batch_size, ...]`. + * <b>`sequence_length`</b>: (optional) An int32/int64 vector sized `[batch_size]`. * <b>`initial_state`</b>: (optional) An initial state for the RNN. If `cell.state_size` is an integer, this must be - a tensor of appropriate type and shape `[batch_size x cell.state_size]`. + a `Tensor` of appropriate type and shape `[batch_size x cell.state_size]`. If `cell.state_size` is a tuple, this should be a tuple of tensors having shapes `[batch_size, s] for s in cell.state_size`. * <b>`dtype`</b>: (optional) The data type for the initial state and expected output. @@ -55,14 +72,26 @@ automatically performed. A pair (outputs, state) where: + * <b>`outputs`</b>: The RNN output `Tensor`. + If time_major == False (default), this will be a `Tensor` shaped: `[batch_size, max_time, cell.output_size]`. + If time_major == True, this will be a `Tensor` shaped: `[max_time, batch_size, cell.output_size]`. -* <b>`state`</b>: The final state. If `cell.state_size` is a `Tensor`, this - will be shaped `[batch_size, cell.state_size]`. If it is a tuple, - this be a tuple with shapes `[batch_size, s] for s in cell.state_size`. + + Note, if `cell.output_size` is a (possibly nested) tuple of integers + or `TensorShape` objects, then `outputs` will be a tuple having the + same structure as `cell.output_size`, containing Tensors having shapes + corresponding to the shape data in `cell.output_size`. + + +* <b>`state`</b>: The final state. If `cell.state_size` is an int, this + will be shaped `[batch_size, cell.state_size]`. If it is a + `TensorShape`, this will be shaped `[batch_size] + cell.state_size`. + If it is a (possibly nested) tuple of ints or `TensorShape`, this will + be a tuple having the corresponding shapes. ##### Raises: diff --git a/tensorflow/g3doc/api_docs/python/nn.md b/tensorflow/g3doc/api_docs/python/nn.md index 5eef5fbf18..69c7334b57 100644 --- a/tensorflow/g3doc/api_docs/python/nn.md +++ b/tensorflow/g3doc/api_docs/python/nn.md @@ -1481,10 +1481,14 @@ Creates a recurrent neural network specified by RNNCell `cell`. This function is functionally identical to the function `rnn` above, but performs fully dynamic unrolling of `inputs`. -Unlike `rnn`, the input `inputs` is not a Python list of `Tensors`. Instead, -it is a single `Tensor` where the maximum time is either the first or second -dimension (see the parameter `time_major`). The corresponding output is -a single `Tensor` having the same number of time steps and batch size. +Unlike `rnn`, the input `inputs` is not a Python list of `Tensors`, one for +each frame. Instead, `inputs` may be a single `Tensor` where +the maximum time is either the first or second dimension (see the parameter +`time_major`). Alternatively, it may be a (possibly nested) tuple of +Tensors, each of them having matching batch and time dimensions. +The corresponding output is either a single `Tensor` having the same number +of time steps and batch size, or a (possibly nested) tuple of such tensors, +matching the nested structure of `cell.output_size`. The parameter `sequence_length` is required and dynamic calculation is automatically performed. @@ -1494,16 +1498,29 @@ automatically performed. * <b>`cell`</b>: An instance of RNNCell. * <b>`inputs`</b>: The RNN inputs. - If time_major == False (default), this must be a tensor of shape: - `[batch_size, max_time, input_size]`, or a nested tuple of such + + If `time_major == False` (default), this must be a `Tensor` of shape: + `[batch_size, max_time, ...]`, or a nested tuple of such elements. - If time_major == True, this must be a tensor of shape: - `[max_time, batch_size, input_size]`, or a nested tuple of such + + If `time_major == True`, this must be a `Tensor` of shape: + `[max_time, batch_size, ...]`, or a nested tuple of such elements. + + This may also be a (possibly nested) tuple of Tensors satisfying + this property. The first two dimensions must match across all the inputs, + but otherwise the ranks and other shape components may differ. + In this case, input to `cell` at each time-step will replicate the + structure of these tuples, except for the time dimension (from which the + time is taken). + + The input to `cell` at each time step will be a `Tensor` or (possibly + nested) tuple of Tensors each with dimensions `[batch_size, ...]`. + * <b>`sequence_length`</b>: (optional) An int32/int64 vector sized `[batch_size]`. * <b>`initial_state`</b>: (optional) An initial state for the RNN. If `cell.state_size` is an integer, this must be - a tensor of appropriate type and shape `[batch_size x cell.state_size]`. + a `Tensor` of appropriate type and shape `[batch_size x cell.state_size]`. If `cell.state_size` is a tuple, this should be a tuple of tensors having shapes `[batch_size, s] for s in cell.state_size`. * <b>`dtype`</b>: (optional) The data type for the initial state and expected output. @@ -1531,14 +1548,26 @@ automatically performed. A pair (outputs, state) where: + * <b>`outputs`</b>: The RNN output `Tensor`. + If time_major == False (default), this will be a `Tensor` shaped: `[batch_size, max_time, cell.output_size]`. + If time_major == True, this will be a `Tensor` shaped: `[max_time, batch_size, cell.output_size]`. -* <b>`state`</b>: The final state. If `cell.state_size` is a `Tensor`, this - will be shaped `[batch_size, cell.state_size]`. If it is a tuple, - this be a tuple with shapes `[batch_size, s] for s in cell.state_size`. + + Note, if `cell.output_size` is a (possibly nested) tuple of integers + or `TensorShape` objects, then `outputs` will be a tuple having the + same structure as `cell.output_size`, containing Tensors having shapes + corresponding to the shape data in `cell.output_size`. + + +* <b>`state`</b>: The final state. If `cell.state_size` is an int, this + will be shaped `[batch_size, cell.state_size]`. If it is a + `TensorShape`, this will be shaped `[batch_size] + cell.state_size`. + If it is a (possibly nested) tuple of ints or `TensorShape`, this will + be a tuple having the corresponding shapes. ##### Raises: @@ -1581,11 +1610,11 @@ The dynamic calculation performed is, at time t for batch row b, * <b>`cell`</b>: An instance of RNNCell. -* <b>`inputs`</b>: A length T list of inputs, each a tensor of shape - [batch_size, input_size], or a nested tuple of such elements. +* <b>`inputs`</b>: A length T list of inputs, each a `Tensor` of shape + `[batch_size, input_size]`, or a nested tuple of such elements. * <b>`initial_state`</b>: (optional) An initial state for the RNN. If `cell.state_size` is an integer, this must be - a tensor of appropriate type and shape `[batch_size x cell.state_size]`. + a `Tensor` of appropriate type and shape `[batch_size, cell.state_size]`. If `cell.state_size` is a tuple, this should be a tuple of tensors having shapes `[batch_size, s] for s in cell.state_size`. * <b>`dtype`</b>: (optional) The data type for the initial state and expected output. @@ -1620,7 +1649,7 @@ RNN that accepts a state saver for time-truncated RNN calculation. * <b>`cell`</b>: An instance of `RNNCell`. -* <b>`inputs`</b>: A length T list of inputs, each a tensor of shape +* <b>`inputs`</b>: A length T list of inputs, each a `Tensor` of shape `[batch_size, input_size]`. * <b>`state_saver`</b>: A state saver object with methods `state` and `save_state`. * <b>`state_name`</b>: Python string or tuple of strings. The name to use with the |