summaryrefslogtreecommitdiff
path: root/nn/runtime/include/NeuralNetworks.h
diff options
context:
space:
mode:
authorYang Ni <yangni@google.com>2017-10-03 22:57:33 -0700
committerYang Ni <yangni@google.com>2017-10-04 12:15:15 -0700
commiteefb1e60444afd08a4350e11f281ac7064ebba63 (patch)
tree29c4f8cb67ed1a05af9236f8b1eb3c3d216aca79 /nn/runtime/include/NeuralNetworks.h
parentf88b4f28ba0d6b04c645551d5b2aa518e30f24f8 (diff)
downloadml-eefb1e60444afd08a4350e11f281ac7064ebba63.tar.gz
Change stateful Ops to stateless ones
Bug: 63905942 Updated Ops RNN, LSTM, and SVDF. Split outputs used for states into inputs and outputs. Test: NeuralNetworksTest Change-Id: Ia3d11f640cba4cab1b94d0b9746c46d347c024a4
Diffstat (limited to 'nn/runtime/include/NeuralNetworks.h')
-rw-r--r--nn/runtime/include/NeuralNetworks.h30
1 files changed, 20 insertions, 10 deletions
diff --git a/nn/runtime/include/NeuralNetworks.h b/nn/runtime/include/NeuralNetworks.h
index 9c932d921..79b6bc595 100644
--- a/nn/runtime/include/NeuralNetworks.h
+++ b/nn/runtime/include/NeuralNetworks.h
@@ -704,17 +704,21 @@ typedef enum {
* A 2-D tensor of type T, of shape [output_size, num_units].
* * 17:projection_bias.
* A 1-D tensor of type T, of shape [output_size].
+ * * 18: output_state (in).
+ * A 2-D tensor of type T, of shape [batch_size, output_size].
+ * * 19: cell_state (in).
+ * A 2-D tensor of type T, of shape [batch_size, num_units].
*
* Parameters:
- * * 18:fused_activation_function.
+ * * 20:fused_activation_function.
* An (optional) ActivationFunctionType indicating the activation
* function.
* If “NONE” is specified then it results in a linear activation.
- * * 19:cell_clip.
+ * * 21:cell_clip.
* A clipping threshold for the cell state, such that values are bound
* within [-cell_clip, cell_clip]. If set to 0.0 then clipping is
* disabled.
- * * 20:proj_clip.
+ * * 22:proj_clip.
* A clipping threshold for the output from the projection layer, such
* that values are bound within [-proj_clip, proj_clip]. If set to 0.0
* then clipping is disabled.
@@ -722,9 +726,9 @@ typedef enum {
* Outputs:
* * 0: scratch_buffer.
* A 3-D tensor of type T, of shape [batch_size, num_cell, 4].
- * * 1: output_state.
+ * * 1: output_state (out).
* A 2-D tensor of type T, of shape [batch_size, output_size].
- * * 2: cell_state.
+ * * 2: cell_state (out).
* A 2-D tensor of type T, of shape [batch_size, num_units].
* * 3: output.
* A 2-D tensor of type T, of shape [batch_size, output_size]. This is
@@ -945,7 +949,7 @@ typedef enum {
* For FLOAT32 input tensor, bias must also be FLOAT32.
* For UINT8 input tensor, bias must be INT32.
*
- * * 4: Hidden state.
+ * * 4: Hidden state (in).
* A 2-D tensor of type T, of shape [batch_size, num_units].
*
* Parameters
@@ -955,7 +959,10 @@ typedef enum {
* activation.
*
* Outputs:
- * * 0: output.
+ * * 0: Hidden state (out).
+ * A 2-D tensor of type T, of shape [batch_size, num_units].
+ *
+ * * 1: output.
* A 2-D tensor of type T, of shape [batch_size, num_units]. This is
* effectively the same as the current state value.
*/
@@ -1074,15 +1081,18 @@ typedef enum {
* For FLOAT32 input tensor, bias must also be FLOAT32.
* For UINT8 input tensor, bias must be INT32.
*
+ * * 4: state (in).
+ * A 2-D tensor of type T, of shape [batch_size, (memory_size - 1) * num_units * rank].
+ *
* Parameters:
- * * 4: rank.
+ * * 5: rank.
* The rank of the SVD approximation.
- * * 5: fused_activation_function.
+ * * 6: fused_activation_function.
* An (optional) ActivationFunctionType indicating the activation function.
* If “NONE” is specified then it results in a linear activation.
*
* Outputs:
- * * 0: state.
+ * * 0: state (out).
* A 2-D tensor of type T, of shape [batch_size, (memory_size - 1) * num_units * rank].
* * 1: output.
* A 2-D tensor of type T, of shape [batch_size, num_units].