summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2017-10-13 07:30:05 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2017-10-13 07:30:05 +0000
commit6cfad8f3f47371aa2a83677c2459a69688126fe7 (patch)
tree2626874d8967aba389a4dd2756224e9bd89fb850
parentfeef3b74ca2989e09ebc23658a215b54f27d85f8 (diff)
parent59c183a7ff87fffd47284a4a3f41479116d71d36 (diff)
downloadml-6cfad8f3f47371aa2a83677c2459a69688126fe7.tar.gz
Snap for 4393674 from 59c183a7ff87fffd47284a4a3f41479116d71d36 to oc-mr1-release
Change-Id: I4108aef1f08312bfaa33ed06c3a6a8394096396e
-rw-r--r--nn/common/Android.bp20
-rw-r--r--nn/common/CpuExecutor.cpp4
-rw-r--r--nn/common/operations/LSTM.cpp236
-rw-r--r--nn/common/operations/LSTMTest.cpp24
-rw-r--r--nn/common/operations/RNNTest.cpp9
-rw-r--r--nn/common/operations/SVDFTest.cpp37
-rw-r--r--nn/common/operations/internal/optimized/cpu_check.h28
-rw-r--r--nn/common/operations/internal/optimized/neon_tensor_utils.cc216
-rw-r--r--nn/common/operations/internal/optimized/neon_tensor_utils.h118
-rw-r--r--nn/common/operations/internal/optimized/tensor_utils_impl.h132
-rw-r--r--nn/common/operations/internal/reference/portable_tensor_utils.cc168
-rw-r--r--nn/common/operations/internal/reference/portable_tensor_utils.h194
-rw-r--r--nn/common/operations/internal/tensor_utils.cc29
-rw-r--r--nn/common/operations/internal/tensor_utils.h122
-rw-r--r--nn/common/operations/internal/tensor_utils_test.cc197
-rw-r--r--nn/driver/sample/SampleDriverAll.cpp2
-rw-r--r--nn/driver/sample/SampleDriverFloatFast.cpp2
-rw-r--r--nn/driver/sample/SampleDriverFloatSlow.cpp2
-rw-r--r--nn/driver/sample/SampleDriverMinimal.cpp2
-rw-r--r--nn/driver/sample/SampleDriverQuant.cpp2
-rw-r--r--nn/runtime/test/generated/all_generated_tests.cpp127
-rw-r--r--nn/runtime/test/generated/examples/lstm.example.cpp2
-rw-r--r--nn/runtime/test/generated/examples/lstm2.example.cpp2
-rw-r--r--nn/runtime/test/generated/examples/lstm2_state.example.cpp22
-rw-r--r--nn/runtime/test/generated/examples/lstm2_state2.example.cpp22
-rw-r--r--nn/runtime/test/generated/examples/lstm3.example.cpp2
-rw-r--r--nn/runtime/test/generated/examples/lstm3_state.example.cpp22
-rw-r--r--nn/runtime/test/generated/examples/lstm3_state2.example.cpp22
-rw-r--r--nn/runtime/test/generated/examples/lstm3_state3.example.cpp22
-rw-r--r--nn/runtime/test/generated/examples/lstm_state.example.cpp22
-rw-r--r--nn/runtime/test/generated/examples/lstm_state2.example.cpp22
-rw-r--r--nn/runtime/test/generated/examples/rnn_state.example.cpp22
-rw-r--r--nn/runtime/test/generated/examples/svdf_state.example.cpp22
-rw-r--r--nn/runtime/test/generated/models/lstm.model.cpp2
-rw-r--r--nn/runtime/test/generated/models/lstm2.model.cpp2
-rw-r--r--nn/runtime/test/generated/models/lstm2_state.model.cpp53
-rw-r--r--nn/runtime/test/generated/models/lstm2_state2.model.cpp53
-rw-r--r--nn/runtime/test/generated/models/lstm3.model.cpp2
-rw-r--r--nn/runtime/test/generated/models/lstm3_state.model.cpp54
-rw-r--r--nn/runtime/test/generated/models/lstm3_state2.model.cpp54
-rw-r--r--nn/runtime/test/generated/models/lstm3_state3.model.cpp54
-rw-r--r--nn/runtime/test/generated/models/lstm_state.model.cpp53
-rw-r--r--nn/runtime/test/generated/models/lstm_state2.model.cpp53
-rw-r--r--nn/runtime/test/generated/models/rnn_state.model.cpp30
-rw-r--r--nn/runtime/test/generated/models/svdf_state.model.cpp32
-rwxr-xr-xnn/runtime/test/specs/generate_test.sh11
-rwxr-xr-xnn/runtime/test/specs/generate_vts_test.sh4
-rw-r--r--nn/runtime/test/specs/lstm.mod.py41
-rw-r--r--nn/runtime/test/specs/lstm2.mod.py32
-rw-r--r--nn/runtime/test/specs/lstm2_state.mod.py145
-rw-r--r--nn/runtime/test/specs/lstm2_state2.mod.py146
-rw-r--r--nn/runtime/test/specs/lstm3.mod.py115
-rw-r--r--nn/runtime/test/specs/lstm3_state.mod.py687
-rw-r--r--nn/runtime/test/specs/lstm3_state2.mod.py687
-rw-r--r--nn/runtime/test/specs/lstm3_state3.mod.py667
-rw-r--r--nn/runtime/test/specs/lstm_state.mod.py152
-rw-r--r--nn/runtime/test/specs/lstm_state2.mod.py152
-rw-r--r--nn/runtime/test/specs/mobilenet_quantized.mod.py (renamed from nn/runtime/test/specs/mobilenet_quantized.model.py)0
-rw-r--r--nn/runtime/test/specs/rnn_state.mod.py127
-rw-r--r--nn/runtime/test/specs/svdf_state.mod.py116
-rw-r--r--nn/tools/test_generator/include/TestHarness.h2
61 files changed, 5077 insertions, 324 deletions
diff --git a/nn/common/Android.bp b/nn/common/Android.bp
index 15ab87588..a499104bd 100644
--- a/nn/common/Android.bp
+++ b/nn/common/Android.bp
@@ -46,6 +46,9 @@ cc_library_static {
"operations/RNN.cpp",
"operations/SimpleMath.cpp",
"operations/SVDF.cpp",
+ "operations/internal/optimized/neon_tensor_utils.cc",
+ "operations/internal/reference/portable_tensor_utils.cc",
+ "operations/internal/tensor_utils.cc",
],
shared_libs: [
"libbase",
@@ -79,6 +82,23 @@ cc_library_static {
}
cc_test {
+ name: "tensor_utils_test",
+ srcs: [
+ "operations/internal/tensor_utils_test.cc",
+ ],
+ shared_libs: [
+ "libneuralnetworks",
+ ],
+ local_include_dirs: [ "include" ],
+ header_libs: [
+ "libneuralnetworks_headers",
+ ],
+ static_libs: [
+ "libgmock",
+ ],
+}
+
+cc_test {
name: "embedding_lookup_test",
srcs: [
"operations/EmbeddingLookupTest.cpp",
diff --git a/nn/common/CpuExecutor.cpp b/nn/common/CpuExecutor.cpp
index 480d6cb15..79f9255bd 100644
--- a/nn/common/CpuExecutor.cpp
+++ b/nn/common/CpuExecutor.cpp
@@ -1206,7 +1206,7 @@ int CpuExecutor::executeOperation(const Operation& operation) {
rnn_cell.Eval();
} break;
case OperationType::SVDF: {
- RunTimeOperandInfo &state =
+ RunTimeOperandInfo &stateOut =
mOperands[outs[SVDF::kStateOutTensor]];
RunTimeOperandInfo &output =
mOperands[outs[SVDF::kOutputTensor]];
@@ -1216,7 +1216,7 @@ int CpuExecutor::executeOperation(const Operation& operation) {
success = SVDF::Prepare(operation, mOperands,
&stateShape, &outputShape) &&
- setInfoAndAllocateIfNeeded(&state, stateShape) &&
+ setInfoAndAllocateIfNeeded(&stateOut, stateShape) &&
setInfoAndAllocateIfNeeded(&output, outputShape) &&
svdf.Eval();
} break;
diff --git a/nn/common/operations/LSTM.cpp b/nn/common/operations/LSTM.cpp
index e7b0dec75..b61463551 100644
--- a/nn/common/operations/LSTM.cpp
+++ b/nn/common/operations/LSTM.cpp
@@ -18,120 +18,13 @@
#include "CpuExecutor.h"
#include "HalInterfaces.h"
+#include "internal/tensor_utils.h"
namespace android {
namespace nn {
-// TODO: move the kernels to a separate file as soon as we have the
-// optimized version ready.
namespace {
-// Limit a float input f between +abs_limit and -abs_limit.
-inline float Clip(float f, float abs_limit) {
- float result = (abs_limit < f) ? abs_limit : f;
- result = (-abs_limit > result) ? -abs_limit : result;
- return result;
-}
-
-// Multiply a matrix by a batch vector, and store results in a batch-size
-// vector.
-void MatrixBatchVectorMultiplyAccumulate(const float* matrix, int m_rows,
- int m_cols, const float* vector,
- int n_batch, float* result) {
- for (int b = 0; b < n_batch; b++) {
- float* result_in_batch = result + b * m_rows;
- const float* matrix_ptr = matrix;
- for (int r = 0; r < m_rows; r++) {
- const float* vector_in_batch = vector + b * m_cols;
- for (int c = 0; c < m_cols; c++) {
- *result_in_batch += *matrix_ptr++ * *vector_in_batch++;
- }
- result_in_batch++;
- }
- }
-}
-
-// Cwise product of two vectors.
-void VectorVectorCwiseProduct(const float* vector1, const float* vector2,
- int v_size, float* result) {
- for (int v = 0; v < v_size; v++) {
- *result++ = *vector1++ * *vector2++;
- }
-}
-
-// Cwise product and accumulation of two vectors. Since it's a MAC operation, the
-// assumption here is that result array is initialized to valid values.
-void VectorVectorCwiseProductAccumulate(const float* vector1,
- const float* vector2, int v_size,
- float* result) {
- for (int v = 0; v < v_size; v++) {
- *result++ += *vector1++ * *vector2++;
- }
-}
-
-// Cwise product and accumulation of a vector and a batch-vector. Since it's a MAC
-// operation, the assumption here is that result array is initialized to valid
-// values.
-void VectorBatchVectorCwiseProductAccumulate(const float* vector, int v_size,
- const float* batch_vector,
- int n_batch, float* result) {
- for (int b = 0; b < n_batch; b++) {
- for (int v = 0; v < v_size; v++) {
- *result++ += vector[v] * *batch_vector++;
- }
- }
-}
-
-// Batch vector initialization with another vector.
-void VectorBatchVectorAssign(const float* vector, int v_size, int n_batch,
- float* batch_vector) {
- for (int b = 0; b < n_batch; b++) {
- memcpy(batch_vector + b * v_size, vector, v_size * sizeof(float));
- }
-}
-
-// Apply sigmoid to elements of a vector.
-void ApplySigmoidToVector(const float* vector, int v_size, float* result) {
- auto sigmoid_func = ActivationFunctor(kActivationSigmoid);
- for (int v = 0; v < v_size; v++) {
- *result++ = (sigmoid_func)(*vector++);
- }
-}
-
-// Apply activation function to elements of a vector.
-void ApplyActivationToVector(const float* vector, int v_size,
- ActivationFn activation, float* result) {
- auto activation_func = ActivationFunctor(activation);
- for (int v = 0; v < v_size; v++) {
- *result++ = (activation_func)(*vector++);
- }
-}
-
-// Copy vector to another vector.
-inline void CopyVector(const float* vector, int v_size, float* result) {
- memcpy(result, vector, v_size * sizeof(float));
-}
-
-// Compute "1.0f - elements of vector" (used in CIFG).
-void Sub1Vector(const float* vector, int v_size, float* result) {
- for (int v = 0; v < v_size; v++) {
- *result++ = 1.0f - *vector++;
- }
-}
-
-// Fill vector with 0.f.
-void ZeroVector(float* vector, int v_size) {
- memset(vector, 0, v_size * sizeof(float));
-}
-
-// Clip elements of a vector using a abs_limit value.
-void ClipVector(const float* vector, int v_size, float abs_limit,
- float* result) {
- for (int v = 0; v < v_size; v++) {
- *result++ = Clip(*vector++, abs_limit);
- }
-}
-
template <typename T>
inline T *GetBuffer(RunTimeOperandInfo* operand) {
return reinterpret_cast<T*>(operand->buffer);
@@ -436,100 +329,102 @@ bool LSTMCell::Eval() {
// Initialize scratch buffers with bias.
if (!use_cifg) {
- VectorBatchVectorAssign(GetBuffer<float>(input_gate_bias_), n_cell, n_batch,
- input_gate_scratch);
+ tensor_utils::VectorBatchVectorAssign(GetBuffer<float>(input_gate_bias_), n_cell, n_batch,
+ input_gate_scratch);
}
- VectorBatchVectorAssign(GetBuffer<float>(forget_gate_bias_), n_cell, n_batch,
- forget_gate_scratch);
- VectorBatchVectorAssign(GetBuffer<float>(cell_bias_), n_cell, n_batch,
- cell_scratch);
- VectorBatchVectorAssign(GetBuffer<float>(output_gate_bias_), n_cell, n_batch,
- output_gate_scratch);
+ tensor_utils::VectorBatchVectorAssign(GetBuffer<float>(forget_gate_bias_), n_cell, n_batch,
+ forget_gate_scratch);
+ tensor_utils::VectorBatchVectorAssign(GetBuffer<float>(cell_bias_), n_cell, n_batch,
+ cell_scratch);
+ tensor_utils::VectorBatchVectorAssign(GetBuffer<float>(output_gate_bias_), n_cell, n_batch,
+ output_gate_scratch);
// For each batch and cell: compute input_weight * input.
if (!use_cifg) {
- MatrixBatchVectorMultiplyAccumulate(
+ tensor_utils::MatrixBatchVectorMultiplyAccumulate(
GetBuffer<float>(input_to_input_weights_), n_cell, n_input,
- GetBuffer<float>(input_), n_batch, input_gate_scratch);
+ GetBuffer<float>(input_), n_batch, input_gate_scratch, /*result_stride*/1);
}
- MatrixBatchVectorMultiplyAccumulate(
+ tensor_utils::MatrixBatchVectorMultiplyAccumulate(
GetBuffer<float>(input_to_forget_weights_), n_cell, n_input,
- GetBuffer<float>(input_), n_batch, forget_gate_scratch);
- MatrixBatchVectorMultiplyAccumulate(
+ GetBuffer<float>(input_), n_batch, forget_gate_scratch, /*result_stride*/1);
+ tensor_utils::MatrixBatchVectorMultiplyAccumulate(
GetBuffer<float>(input_to_cell_weights_), n_cell, n_input,
- GetBuffer<float>(input_), n_batch, cell_scratch);
- MatrixBatchVectorMultiplyAccumulate(
+ GetBuffer<float>(input_), n_batch, cell_scratch, /*result_stride*/1);
+ tensor_utils::MatrixBatchVectorMultiplyAccumulate(
GetBuffer<float>(input_to_output_weights_), n_cell, n_input,
- GetBuffer<float>(input_), n_batch, output_gate_scratch);
+ GetBuffer<float>(input_), n_batch, output_gate_scratch, /*result_stride*/1);
// For each batch and cell: compute recurrent_weight * output_state.
if (!use_cifg) {
- MatrixBatchVectorMultiplyAccumulate(
+ tensor_utils::MatrixBatchVectorMultiplyAccumulate(
GetBuffer<float>(recurrent_to_input_weights_), n_cell, n_output,
- GetBuffer<float>(output_state_in_), n_batch, input_gate_scratch);
+ GetBuffer<float>(output_state_in_), n_batch, input_gate_scratch, /*result_stride*/1);
}
- MatrixBatchVectorMultiplyAccumulate(
+ tensor_utils::MatrixBatchVectorMultiplyAccumulate(
GetBuffer<float>(recurrent_to_forget_weights_), n_cell, n_output,
- GetBuffer<float>(output_state_in_), n_batch, forget_gate_scratch);
- MatrixBatchVectorMultiplyAccumulate(
+ GetBuffer<float>(output_state_in_), n_batch, forget_gate_scratch, /*result_stride*/1);
+ tensor_utils::MatrixBatchVectorMultiplyAccumulate(
GetBuffer<float>(recurrent_to_cell_weights_), n_cell, n_output,
- GetBuffer<float>(output_state_in_), n_batch, cell_scratch);
- MatrixBatchVectorMultiplyAccumulate(
+ GetBuffer<float>(output_state_in_), n_batch, cell_scratch, /*result_stride*/1);
+ tensor_utils::MatrixBatchVectorMultiplyAccumulate(
GetBuffer<float>(recurrent_to_output_weights_), n_cell, n_output,
- GetBuffer<float>(output_state_in_), n_batch, output_gate_scratch);
+ GetBuffer<float>(output_state_in_), n_batch, output_gate_scratch, /*result_stride*/1);
// For each batch and cell: update input gate.
if (!use_cifg) {
if (use_peephole) {
- VectorBatchVectorCwiseProductAccumulate(
+ tensor_utils::VectorBatchVectorCwiseProductAccumulate(
GetBuffer<float>(cell_to_input_weights_), n_cell,
GetBuffer<float>(cell_state_in_), n_batch, input_gate_scratch);
}
- ApplySigmoidToVector(input_gate_scratch, n_cell * n_batch,
- input_gate_scratch);
+ tensor_utils::ApplySigmoidToVector(input_gate_scratch, n_cell * n_batch,
+ input_gate_scratch);
}
// For each batch and cell: update forget gate.
if (use_peephole) {
- VectorBatchVectorCwiseProductAccumulate(
+ tensor_utils::VectorBatchVectorCwiseProductAccumulate(
GetBuffer<float>(cell_to_forget_weights_), n_cell,
GetBuffer<float>(cell_state_in_), n_batch, forget_gate_scratch);
}
- ApplySigmoidToVector(forget_gate_scratch, n_cell * n_batch,
- forget_gate_scratch);
+ tensor_utils::ApplySigmoidToVector(forget_gate_scratch, n_cell * n_batch,
+ forget_gate_scratch);
// For each batch and cell: update the cell.
- VectorVectorCwiseProduct(forget_gate_scratch, GetBuffer<float>(cell_state_in_),
- n_batch * n_cell, GetBuffer<float>(cell_state_out_));
- ApplyActivationToVector(cell_scratch, n_batch * n_cell, params_.activation_,
- cell_scratch);
+ tensor_utils::VectorVectorCwiseProduct(
+ forget_gate_scratch, GetBuffer<float>(cell_state_in_), n_batch * n_cell,
+ GetBuffer<float>(cell_state_out_));
+ tensor_utils::ApplyActivationToVector(
+ cell_scratch, n_batch * n_cell, params_.activation_, cell_scratch);
if (use_cifg) {
- Sub1Vector(forget_gate_scratch, n_batch * n_cell, forget_gate_scratch);
- VectorVectorCwiseProductAccumulate(cell_scratch, forget_gate_scratch,
- n_batch * n_cell,
- GetBuffer<float>(cell_state_out_));
+ tensor_utils::Sub1Vector(forget_gate_scratch, n_batch * n_cell,
+ forget_gate_scratch);
+ tensor_utils::VectorVectorCwiseProductAccumulate(
+ cell_scratch, forget_gate_scratch, n_batch * n_cell,
+ GetBuffer<float>(cell_state_out_));
} else {
- VectorVectorCwiseProductAccumulate(cell_scratch, input_gate_scratch,
- n_batch * n_cell,
- GetBuffer<float>(cell_state_out_));
+ tensor_utils::VectorVectorCwiseProductAccumulate(
+ cell_scratch, input_gate_scratch, n_batch * n_cell,
+ GetBuffer<float>(cell_state_out_));
}
if (params_.cell_clip_ > 0.0) {
- ClipVector(GetBuffer<float>(cell_state_out_), n_batch * n_cell,
- params_.cell_clip_, GetBuffer<float>(cell_state_out_));
+ tensor_utils::ClipVector(GetBuffer<float>(cell_state_out_), n_batch * n_cell,
+ params_.cell_clip_, GetBuffer<float>(cell_state_out_));
}
// For each batch and cell: update the output gate.
if (use_peephole) {
- VectorBatchVectorCwiseProductAccumulate(
+ tensor_utils::VectorBatchVectorCwiseProductAccumulate(
GetBuffer<float>(cell_to_output_weights_), n_cell,
GetBuffer<float>(cell_state_out_), n_batch, output_gate_scratch);
}
- ApplySigmoidToVector(output_gate_scratch, n_batch * n_cell,
- output_gate_scratch);
- ApplyActivationToVector(GetBuffer<float>(cell_state_out_), n_batch * n_cell,
- params_.activation_, cell_scratch);
- VectorVectorCwiseProduct(output_gate_scratch, cell_scratch, n_batch * n_cell,
- output_gate_scratch);
+ tensor_utils::ApplySigmoidToVector(output_gate_scratch, n_batch * n_cell,
+ output_gate_scratch);
+ tensor_utils::ApplyActivationToVector(GetBuffer<float>(cell_state_out_), n_batch * n_cell,
+ params_.activation_, cell_scratch);
+ tensor_utils::VectorVectorCwiseProduct(output_gate_scratch, cell_scratch, n_batch * n_cell,
+ output_gate_scratch);
// For each batch: update the projection and output_state.
const bool use_projection_weight =
@@ -537,24 +432,25 @@ bool LSTMCell::Eval() {
const bool use_projection_bias = (projection_bias_->lifetime != OperandLifeTime::NO_VALUE);
if (use_projection_weight) {
if (use_projection_bias) {
- VectorBatchVectorAssign(GetBuffer<float>(projection_bias_), n_output,
- n_batch, GetBuffer<float>(output_));
+ tensor_utils::VectorBatchVectorAssign(GetBuffer<float>(projection_bias_), n_output,
+ n_batch, GetBuffer<float>(output_));
} else {
- ZeroVector(GetBuffer<float>(output_), n_batch * n_output);
+ tensor_utils::ZeroVector(GetBuffer<float>(output_), n_batch * n_output);
}
- MatrixBatchVectorMultiplyAccumulate(GetBuffer<float>(projection_weights_),
- n_output, n_cell, output_gate_scratch,
- n_batch, GetBuffer<float>(output_));
+ tensor_utils::MatrixBatchVectorMultiplyAccumulate(
+ GetBuffer<float>(projection_weights_), n_output, n_cell,
+ output_gate_scratch, n_batch, GetBuffer<float>(output_),
+ /*result_stride*/1);
if (params_.proj_clip_ > 0.0) {
- ClipVector(GetBuffer<float>(output_), n_batch * n_output,
- params_.proj_clip_, GetBuffer<float>(output_));
+ tensor_utils::ClipVector(GetBuffer<float>(output_), n_batch * n_output,
+ params_.proj_clip_, GetBuffer<float>(output_));
}
} else {
- CopyVector(output_gate_scratch, n_batch * n_output,
- GetBuffer<float>(output_));
+ tensor_utils::CopyVector(output_gate_scratch, n_batch * n_output,
+ GetBuffer<float>(output_));
}
- CopyVector(GetBuffer<float>(output_), n_batch * n_output,
- GetBuffer<float>(output_state_out_));
+ tensor_utils::CopyVector(GetBuffer<float>(output_), n_batch * n_output,
+ GetBuffer<float>(output_state_out_));
return true;
}
diff --git a/nn/common/operations/LSTMTest.cpp b/nn/common/operations/LSTMTest.cpp
index 6a05e04da..ce2d5d72a 100644
--- a/nn/common/operations/LSTMTest.cpp
+++ b/nn/common/operations/LSTMTest.cpp
@@ -66,10 +66,10 @@ std::vector<Matcher<float>> ArrayFloatNear(const std::vector<float>& values,
// For all output and intermediate states
#define FOR_ALL_OUTPUT_TENSORS(ACTION) \
- ACTION(Output) \
+ ACTION(ScratchBuffer) \
ACTION(OutputStateOut) \
ACTION(CellStateOut) \
- ACTION(ScratchBuffer)
+ ACTION(Output) \
class LSTMOpModel {
public:
@@ -86,10 +86,11 @@ public:
activation_(ActivationFn::kActivationTanh),
cell_clip_(cell_clip), proj_clip_(proj_clip) {
std::vector<uint32_t> inputs;
- std::vector<std::vector<uint32_t>> input_shapes(input_shapes0.begin(), input_shapes0.end());
- auto it = input_shapes.begin();
+ std::vector<std::vector<uint32_t>> input_shapes(input_shapes0);
+
input_shapes.push_back({n_batch, n_output});
input_shapes.push_back({n_batch, n_cell});
+ auto it = input_shapes.begin();
// Input and weights
#define AddInput(X) \
@@ -110,10 +111,10 @@ public:
// Output and other intermediate state
std::vector<std::vector<uint32_t>> output_shapes{
- {n_batch, n_output},
+ {n_batch, n_cell * (use_cifg ? 3 : 4)},
{n_batch, n_output},
{n_batch, n_cell},
- {n_batch, n_cell, 4}
+ {n_batch, n_output},
};
std::vector<uint32_t> outputs;
@@ -131,6 +132,8 @@ public:
model_.identifyInputsAndOutputs(inputs, outputs);
Input_.insert(Input_.end(), n_batch * n_input, 0.f);
+ OutputStateIn_.insert(OutputStateIn_.end(), n_batch * n_output, 0.f);
+ CellStateIn_.insert(CellStateIn_.end(), n_batch * n_cell, 0.f);
auto multiAll = [](const std::vector<uint32_t> &dims) -> uint32_t {
uint32_t sz = 1;
@@ -160,10 +163,12 @@ public:
void ResetOutputState() {
std::fill(OutputStateIn_.begin(), OutputStateIn_.end(), 0.f);
+ std::fill(OutputStateOut_.begin(), OutputStateOut_.end(), 0.f);
}
void ResetCellState() {
std::fill(CellStateIn_.begin(), CellStateIn_.end(), 0.f);
+ std::fill(CellStateOut_.begin(), CellStateOut_.end(), 0.f);
}
void SetInput(int offset, float *begin, float *end) {
@@ -180,12 +185,15 @@ public:
void Invoke() {
ASSERT_TRUE(model_.isValid());
+ OutputStateIn_.swap(OutputStateOut_);
+ CellStateIn_.swap(CellStateOut_);
+
Compilation compilation(&model_);
compilation.finish();
Execution execution(&compilation);
#define SetInputOrWeight(X) \
ASSERT_EQ(execution.setInput(LSTMCell::k##X##Tensor, X##_.data(), \
- sizeof(X##_)), \
+ sizeof(float)*X##_.size()), \
Result::NO_ERROR);
FOR_ALL_INPUT_AND_WEIGHT_TENSORS(SetInputOrWeight);
@@ -194,7 +202,7 @@ public:
#define SetOutput(X) \
ASSERT_EQ(execution.setOutput(LSTMCell::k##X##Tensor, X##_.data(), \
- sizeof(X##_)), \
+ sizeof(float)*X##_.size()), \
Result::NO_ERROR);
FOR_ALL_OUTPUT_TENSORS(SetOutput);
diff --git a/nn/common/operations/RNNTest.cpp b/nn/common/operations/RNNTest.cpp
index 323484bbd..58243d92b 100644
--- a/nn/common/operations/RNNTest.cpp
+++ b/nn/common/operations/RNNTest.cpp
@@ -203,6 +203,7 @@ class BasicRNNOpModel {
void ResetHiddenState() {
std::fill(HiddenStateIn_.begin(), HiddenStateIn_.end(), 0.f);
+ std::fill(HiddenStateOut_.begin(), HiddenStateOut_.end(), 0.f);
}
const std::vector<float>& GetOutput() const { return Output_; }
@@ -214,11 +215,14 @@ class BasicRNNOpModel {
void Invoke() {
ASSERT_TRUE(model_.isValid());
+ HiddenStateIn_.swap(HiddenStateOut_);
+
Compilation compilation(&model_);
compilation.finish();
Execution execution(&compilation);
#define SetInputOrWeight(X) \
- ASSERT_EQ(execution.setInput(RNN::k##X##Tensor, X##_.data(), sizeof(X##_)), \
+ ASSERT_EQ(execution.setInput(RNN::k##X##Tensor, X##_.data(), \
+ sizeof(float) * X##_.size()), \
Result::NO_ERROR);
FOR_ALL_INPUT_AND_WEIGHT_TENSORS(SetInputOrWeight);
@@ -226,7 +230,8 @@ class BasicRNNOpModel {
#undef SetInputOrWeight
#define SetOutput(X) \
- ASSERT_EQ(execution.setOutput(RNN::k##X##Tensor, X##_.data(), sizeof(X##_)), \
+ ASSERT_EQ(execution.setOutput(RNN::k##X##Tensor, X##_.data(), \
+ sizeof(float) * X##_.size()), \
Result::NO_ERROR);
FOR_ALL_OUTPUT_TENSORS(SetOutput);
diff --git a/nn/common/operations/SVDFTest.cpp b/nn/common/operations/SVDFTest.cpp
index b5940e045..0bd59bab6 100644
--- a/nn/common/operations/SVDFTest.cpp
+++ b/nn/common/operations/SVDFTest.cpp
@@ -120,17 +120,18 @@ static float svdf_golden_output[] = {
class SVDFOpModel {
public:
SVDFOpModel(uint32_t batches, uint32_t units, uint32_t input_size,
- uint32_t memory_size)
+ uint32_t memory_size, uint32_t rank)
: batches_(batches),
units_(units),
input_size_(input_size),
- memory_size_(memory_size) {
+ memory_size_(memory_size),
+ rank_(rank) {
std::vector<std::vector<uint32_t>> input_shapes{
{batches_, input_size_}, // Input tensor
- {units_, input_size_}, // weights_feature tensor
- {units_, memory_size_}, // weights_time tensor
+ {units_ * rank_, input_size_}, // weights_feature tensor
+ {units_ * rank_, memory_size_}, // weights_time tensor
{units_}, // bias tensor
- {batches_, (memory_size_ - 1) * units_}, // state in
+ {batches_, memory_size * units_ * rank_}, // state in tensor
};
std::vector<uint32_t> inputs;
auto it = input_shapes.begin();
@@ -151,7 +152,7 @@ class SVDFOpModel {
inputs.push_back(model_.addOperand(&ActivationParamTy));
// Output and other intermediate state
- std::vector<std::vector<uint32_t>> output_shapes{{batches_, (memory_size_ - 1) * units_},
+ std::vector<std::vector<uint32_t>> output_shapes{{batches_, memory_size_ * units_ * rank_},
{batches_, units_}};
std::vector<uint32_t> outputs;
@@ -166,6 +167,7 @@ class SVDFOpModel {
#undef AddOutput
Input_.insert(Input_.end(), batches_ * input_size_, 0.f);
+ StateIn_.insert(StateIn_.end(), batches_ * units_ * rank_ * memory_size_, 0.f);
auto multiAll = [](const std::vector<uint32_t> &dims) -> uint32_t {
uint32_t sz = 1;
@@ -191,8 +193,12 @@ class SVDFOpModel {
Compilation compilation(&model_);
compilation.finish();
Execution execution(&compilation);
+
+ StateIn_.swap(StateOut_);
+
#define SetInputOrWeight(X) \
- ASSERT_EQ(execution.setInput(SVDF::k##X##Tensor, X##_.data(), sizeof(X##_)), \
+ ASSERT_EQ(execution.setInput(SVDF::k##X##Tensor, X##_.data(), \
+ sizeof(float) * X##_.size()), \
Result::NO_ERROR);
FOR_ALL_INPUT_AND_WEIGHT_TENSORS(SetInputOrWeight);
@@ -200,15 +206,16 @@ class SVDFOpModel {
#undef SetInputOrWeight
#define SetOutput(X) \
- ASSERT_EQ(execution.setOutput(SVDF::k##X##Tensor, X##_.data(), sizeof(X##_)), \
+ EXPECT_TRUE(X##_.data() != nullptr); \
+ ASSERT_EQ(execution.setOutput(SVDF::k##X##Tensor, X##_.data(), \
+ sizeof(float) * X##_.size()), \
Result::NO_ERROR);
FOR_ALL_OUTPUT_TENSORS(SetOutput);
#undef SetOutput
- int rank = 1;
- ASSERT_EQ(execution.setInput(SVDF::kRankParam, &rank, sizeof(rank)),
+ ASSERT_EQ(execution.setInput(SVDF::kRankParam, &rank_, sizeof(rank_)),
Result::NO_ERROR);
int activation = ActivationFn::kActivationNone;
@@ -235,7 +242,10 @@ class SVDFOpModel {
}
// Resets the state of SVDF op by filling it with 0's.
- void ResetState() { std::fill(StateIn_.begin(), StateIn_.end(), 0.f); }
+ void ResetState() {
+ std::fill(StateIn_.begin(), StateIn_.end(), 0.f);
+ std::fill(StateOut_.begin(), StateOut_.end(), 0.f);
+ }
// Extracts the output tensor from the SVDF op.
const std::vector<float>& GetOutput() const { return Output_; }
@@ -251,6 +261,7 @@ class SVDFOpModel {
const uint32_t units_;
const uint32_t input_size_;
const uint32_t memory_size_;
+ const uint32_t rank_;
#define DefineTensor(X) std::vector<float> X##_;
@@ -262,7 +273,7 @@ class SVDFOpModel {
TEST(SVDFOpTest, BlackBoxTest) {
SVDFOpModel svdf(/*batches=*/2, /*units=*/4, /*input_size=*/3,
- /*memory_size=*/10);
+ /*memory_size=*/10, /*rank=*/1);
svdf.SetWeightsFeature({-0.31930989, -0.36118156, 0.0079667, 0.37613347,
0.22197971, 0.12416199, 0.27901134, 0.27557442,
0.3905206, -0.36137494, -0.06634006, -0.10640851});
@@ -280,6 +291,8 @@ TEST(SVDFOpTest, BlackBoxTest) {
-0.10781813, 0.27201805, 0.14324132, -0.23681851, -0.27115166,
-0.01580888, -0.14943552, 0.15465137, 0.09784451, -0.0337657});
+ svdf.SetBias({});
+
svdf.ResetState();
const int svdf_num_batches = svdf.num_batches();
const int svdf_input_size = svdf.input_size();
diff --git a/nn/common/operations/internal/optimized/cpu_check.h b/nn/common/operations/internal/optimized/cpu_check.h
new file mode 100644
index 000000000..02f42fd42
--- /dev/null
+++ b/nn/common/operations/internal/optimized/cpu_check.h
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef FRAMEWORKS_ML_NN_COMMON_OPERATIONS_INTERNAL_OPTIMIZED_CPU_CHECK_
+#define FRAMEWORKS_ML_NN_COMMON_OPERATIONS_INTERNAL_OPTIMIZED_CPU_CHECK_
+
+// NEON_OR_PORTABLE(SomeFunc, arcs) calls NeonSomeFunc(args) if NEON is
+// enabled at build time, or PortableSomeFunc(args) otherwise.
+#if defined(__ARM_NEON__) || defined(__ARM_NEON)
+#define NEON_OR_PORTABLE(funcname, ...) Neon##funcname(__VA_ARGS__)
+#else
+#define NEON_OR_PORTABLE(funcname, ...) Portable##funcname(__VA_ARGS__)
+#endif
+
+#endif // FRAMEWORKS_ML_NN_COMMON_OPERATIONS_INTERNAL_OPTIMIZED_CPU_CHECK_
diff --git a/nn/common/operations/internal/optimized/neon_tensor_utils.cc b/nn/common/operations/internal/optimized/neon_tensor_utils.cc
new file mode 100644
index 000000000..f17730fc5
--- /dev/null
+++ b/nn/common/operations/internal/optimized/neon_tensor_utils.cc
@@ -0,0 +1,216 @@
+/*
+ * Copyright 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <string.h>
+
+#include "ActivationFunctor.h"
+#include "tensor_utils_impl.h"
+
+#ifdef USE_NEON
+
+#include <arm_neon.h>
+#define kFloatWeightsPerNeonLane 4
+
+namespace android {
+namespace nn {
+namespace tensor_utils {
+
+void NeonMatrixBatchVectorMultiplyAccumulate(const float* matrix, int m_rows,
+ int m_cols, const float* vector,
+ int n_batch, float* result,
+ int result_stride) {
+ // If v_size is not divisible by kWeightsPerNeonLane, we cannot use the main
+ // vectorized loop, and we need to process sequentially. postamble_start shows
+ // the start index where this should happen.
+ const int postamble_start =
+ m_cols - (m_cols & (kFloatWeightsPerNeonLane - 1));
+
+ // The arrays used to cache the vector.
+ float32x4_t* vector_cache_float32x4 =
+ new float32x4_t[(m_cols / kFloatWeightsPerNeonLane) *
+ sizeof(float32x4_t)];
+
+ for (int b = 0; b < n_batch; b++) {
+ float* result_in_batch = result + b * m_rows;
+ const float* vector_in_batch = vector + b * m_cols;
+ const float* matrix_ptr = matrix;
+ for (int c = 0; c < postamble_start; c += kFloatWeightsPerNeonLane) {
+ vector_cache_float32x4[c >> 2] = vld1q_f32(vector_in_batch + c);
+ }
+ for (int r = 0; r < m_rows; r++) {
+ float32x4_t acc_32x4 = vmovq_n_f32(0.0);
+ for (int c = 0; c < postamble_start; c += kFloatWeightsPerNeonLane) {
+ float32x4_t temp = vector_cache_float32x4[c >> 2];
+ // Load 4 float values from vector1 and vector2 and accumulator.
+ float32x4_t v1_f32x4 = vld1q_f32(matrix_ptr + c);
+ // Vector multiply-accumulate 4 float
+ acc_32x4 = vmlaq_f32(acc_32x4, v1_f32x4, temp);
+ }
+ // Add the 4 intermediate sum values to get the final dot-prod value for
+ // this column.
+ *result_in_batch +=
+ (vgetq_lane_f32(acc_32x4, 0) + vgetq_lane_f32(acc_32x4, 1) +
+ vgetq_lane_f32(acc_32x4, 2) + vgetq_lane_f32(acc_32x4, 3));
+ for (int c = postamble_start; c < m_cols; c++) {
+ *result_in_batch += matrix_ptr[c] * vector_in_batch[c];
+ }
+ matrix_ptr += m_cols;
+ result_in_batch += result_stride;
+ }
+ }
+ delete[] vector_cache_float32x4;
+}
+
+void NeonVectorVectorCwiseProduct(const float* vector1, const float* vector2,
+ int v_size, float* result) {
+ // If v_size is not divisible by kWeightsPerNeonLane, we cannot use the main
+ // vectorized loop, and we need to process sequentially. postamble_start shows
+ // the start index where this should happen.
+ const int postamble_start =
+ v_size - (v_size & (kFloatWeightsPerNeonLane - 1));
+ for (int v = 0; v < postamble_start; v += kFloatWeightsPerNeonLane) {
+ // Load 4 float values from vector1 and vector2.
+ float32x4_t v1_f32x4 = vld1q_f32(vector1 + v);
+ float32x4_t v2_f32x4 = vld1q_f32(vector2 + v);
+ // Vector multiply 4 float
+ float32x4_t mul_32x4 = vmulq_f32(v1_f32x4, v2_f32x4);
+ // Save to result array.
+ vst1q_f32(&result[v], mul_32x4);
+ }
+ for (int v = postamble_start; v < v_size; v++) {
+ result[v] = vector1[v] * vector2[v];
+ }
+}
+
+void NeonVectorVectorCwiseProductAccumulate(const float* vector1,
+ const float* vector2, int v_size,
+ float* result) {
+ // If v_size is not divisible by kWeightsPerNeonLane, we cannot use the main
+ // vectorized loop, and we need to process sequentially. postamble_start shows
+ // the start index where this should happen.
+ const int postamble_start =
+ v_size - (v_size & (kFloatWeightsPerNeonLane - 1));
+ for (int v = 0; v < postamble_start; v += kFloatWeightsPerNeonLane) {
+ // Load 4 float values from vector1 and vector2 and accumulator.
+ float32x4_t v1_f32x4 = vld1q_f32(vector1 + v);
+ float32x4_t v2_f32x4 = vld1q_f32(vector2 + v);
+ float32x4_t acc_32x4 = vld1q_f32(result + v);
+ // Vector multiply-accumulate 4 float
+ acc_32x4 = vmlaq_f32(acc_32x4, v1_f32x4, v2_f32x4);
+ // Save to result array.
+ vst1q_f32(&result[v], acc_32x4);
+ }
+ for (int v = postamble_start; v < v_size; v++) {
+ result[v] += vector1[v] * vector2[v];
+ }
+}
+
+void NeonVectorBatchVectorCwiseProductAccumulate(const float* vector,
+ int v_size,
+ const float* batch_vector,
+ int n_batch, float* result) {
+ // If v_size is not divisible by kWeightsPerNeonLane, we cannot use the main
+ // vectorized loop, and we need to process sequentially. postamble_start shows
+ // the start index where this should happen.
+ const int postamble_start =
+ v_size - (v_size & (kFloatWeightsPerNeonLane - 1));
+
+ // The arrays used to cache the vector.
+ float32x4_t* vector_cache_float32x4 =
+ new float32x4_t[(v_size / kFloatWeightsPerNeonLane) *
+ sizeof(float32x4_t)];
+ for (int v = 0; v < postamble_start; v += kFloatWeightsPerNeonLane) {
+ vector_cache_float32x4[v >> 2] = vld1q_f32(vector + v);
+ }
+
+ float* result_ptr = result;
+ const float* batch_vector_ptr = batch_vector;
+ for (int b = 0; b < n_batch; b++) {
+ for (int v = 0; v < postamble_start; v += kFloatWeightsPerNeonLane) {
+ // Load from memory to vectors.
+ float32x4_t result_f32x4 = vld1q_f32(result_ptr + v);
+ float32x4_t batch_vector_f32x4 = vld1q_f32(batch_vector_ptr + v);
+ // Multiply-accumulate.
+ result_f32x4 = vmlaq_f32(result_f32x4, batch_vector_f32x4,
+ vector_cache_float32x4[v >> 2]);
+ // Store.
+ vst1q_f32(result_ptr + v, result_f32x4);
+ }
+ // Postamble loop
+ for (int v = postamble_start; v < v_size; v++) {
+ result_ptr[v] += vector[v] * batch_vector_ptr[v];
+ }
+ // Update the pointers.
+ result_ptr += v_size;
+ batch_vector_ptr += v_size;
+ }
+ delete[] vector_cache_float32x4;
+}
+
+void NeonSub1Vector(const float* vector, int v_size, float* result) {
+ // If v_size is not divisible by kWeightsPerNeonLane, we cannot use the main
+ // vectorized loop, and we need to process sequentially. postamble_start shows
+ // the start index where this should happen.
+ const int postamble_start =
+ v_size - (v_size & (kFloatWeightsPerNeonLane - 1));
+
+ float32x4_t one_f32x4 = vmovq_n_f32(1.0);
+ for (int v = 0; v < postamble_start; v += kFloatWeightsPerNeonLane) {
+ // Load 4 float values from the current pointers of the input column and
+ // subtract from 1.
+ float32x4_t v_f32x4 = vld1q_f32(vector + v);
+ float32x4_t result_f32x4 = vsubq_f32(one_f32x4, v_f32x4);
+ // Save to output.
+ vst1q_f32(result + v, result_f32x4);
+ }
+ for (int v = postamble_start; v < v_size; v++) {
+ result[v] = 1.0f - vector[v];
+ }
+}
+
+void NeonClipVector(const float* vector, int v_size, float abs_limit,
+ float* result) {
+ // If v_size is not divisible by kWeightsPerNeonLane, we cannot use the main
+ // vectorized loop, and we need to process sequentially. postamble_start shows
+ // the start index where this should happen.
+ const int postamble_start =
+ v_size - (v_size & (kFloatWeightsPerNeonLane - 1));
+
+ // Replicate abs_limit and -abs_limit in two vectors.
+ const float32x4_t abs_limit_f32x4 = vmovq_n_f32(abs_limit);
+ const float32x4_t neg_abs_limit_f32x4 = vmovq_n_f32(-abs_limit);
+
+ for (int v = 0; v < postamble_start; v += kFloatWeightsPerNeonLane) {
+ // Load from memory to vector.
+ float32x4_t v_f32x4 = vld1q_f32(vector + v);
+ // Clip between abs_limit and -abs_limit.
+ float32x4_t result_f32x4 = vminq_f32(abs_limit_f32x4, v_f32x4);
+ result_f32x4 = vmaxq_f32(neg_abs_limit_f32x4, result_f32x4);
+ // Save to output.
+ vst1q_f32(result + v, result_f32x4);
+ }
+ // Postamble loop.
+ for (int v = postamble_start; v < v_size; v++) {
+ result[v] = (abs_limit < vector[v]) ? abs_limit : vector[v];
+ result[v] = (-abs_limit > result[v]) ? -abs_limit : result[v];
+ }
+}
+
+} // namespace tensor_utils
+} // namespace nn
+} // namespace android
+
+#endif // USE_NEON
diff --git a/nn/common/operations/internal/optimized/neon_tensor_utils.h b/nn/common/operations/internal/optimized/neon_tensor_utils.h
new file mode 100644
index 000000000..92a151cc1
--- /dev/null
+++ b/nn/common/operations/internal/optimized/neon_tensor_utils.h
@@ -0,0 +1,118 @@
+/*
+ * Copyright 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef FRAMEWORKS_ML_NN_COMMON_OPERATIONS_INTERNAL_OPTIMIZED_NEON_TENSOR_UTILS_H_
+#define FRAMEWORKS_ML_NN_COMMON_OPERATIONS_INTERNAL_OPTIMIZED_NEON_TENSOR_UTILS_H_
+
+#include "ActivationFunctor.h"
+#include "cpu_check.h"
+#include "tensor_utils_impl.h"
+
+namespace android {
+namespace nn {
+namespace tensor_utils {
+
+void MatrixBatchVectorMultiplyAccumulate(const float* matrix, int m_rows,
+ int m_cols, const float* vector,
+ int n_batch, float* result,
+ int result_stride) {
+ NEON_OR_PORTABLE(MatrixBatchVectorMultiplyAccumulate, matrix, m_rows, m_cols,
+ vector, n_batch, result, result_stride);
+}
+
+void VectorVectorCwiseProduct(const float* vector1, const float* vector2,
+ int v_size, float* result) {
+ NEON_OR_PORTABLE(VectorVectorCwiseProduct, vector1, vector2, v_size, result);
+}
+
+void VectorVectorCwiseProductAccumulate(const float* vector1,
+ const float* vector2, int v_size,
+ float* result) {
+ NEON_OR_PORTABLE(VectorVectorCwiseProductAccumulate, vector1, vector2, v_size,
+ result);
+}
+
+void VectorBatchVectorCwiseProductAccumulate(const float* vector, int v_size,
+ const float* batch_vector,
+ int n_batch, float* result) {
+ NEON_OR_PORTABLE(VectorBatchVectorCwiseProductAccumulate, vector, v_size,
+ batch_vector, n_batch, result);
+}
+
+float VectorVectorDotProduct(const float* vector1, const float* vector2,
+ int v_size) {
+ return PortableVectorVectorDotProduct(vector1, vector2, v_size);
+}
+
+void BatchVectorBatchVectorDotProduct(const float* vector1,
+ const float* vector2, int v_size,
+ int n_batch, float* result,
+ int result_stride) {
+ PortableBatchVectorBatchVectorDotProduct(vector1, vector2, v_size, n_batch,
+ result, result_stride);
+}
+
+void VectorBatchVectorAssign(const float* vector, int v_size, int n_batch,
+ float* batch_vector) {
+ PortableVectorBatchVectorAssign(vector, v_size, n_batch, batch_vector);
+}
+
+void ApplySigmoidToVector(const float* vector, int v_size, float* result) {
+ PortableApplySigmoidToVector(vector, v_size, result);
+}
+
+void ApplyActivationToVector(const float* vector, int v_size,
+ ActivationFn activation, float* result) {
+ PortableApplyActivationToVector(vector, v_size, activation, result);
+}
+
+void CopyVector(const float* vector, int v_size, float* result) {
+ PortableCopyVector(vector, v_size, result);
+}
+
+void Sub1Vector(const float* vector, int v_size, float* result) {
+ NEON_OR_PORTABLE(Sub1Vector, vector, v_size, result);
+}
+
+void ZeroVector(float* vector, int v_size) {
+ PortableZeroVector(vector, v_size);
+}
+
+float Clip(float f, float abs_limit) { return PortableClip(f, abs_limit); }
+
+void ClipVector(const float* vector, int v_size, float abs_limit,
+ float* result) {
+ NEON_OR_PORTABLE(ClipVector, vector, v_size, abs_limit, result);
+}
+
+// TODO(ghodrat): Implement Neon version.
+void VectorShiftLeft(float* vector, int v_size, float shift_value) {
+ PortableVectorShiftLeft(vector, v_size, shift_value);
+}
+
+// TODO(ghodrat): Implement Neon version.
+void ReductionSumVector(const float* input_vector, int input_stride,
+ float* output_vector, int output_size,
+ int reduction_size) {
+ PortableReductionSumVector(input_vector, input_stride, output_vector,
+ output_size, reduction_size);
+}
+
+} // namespace tensor_utils
+} // namespace nn
+} // namespace android
+
+#endif // FRAMEWORKS_ML_NN_COMMON_OPERATIONS_INTERNAL_OPTIMIZED_NEON_TENSOR_UTILS_H_
diff --git a/nn/common/operations/internal/optimized/tensor_utils_impl.h b/nn/common/operations/internal/optimized/tensor_utils_impl.h
new file mode 100644
index 000000000..249a67255
--- /dev/null
+++ b/nn/common/operations/internal/optimized/tensor_utils_impl.h
@@ -0,0 +1,132 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef FRAMEWORKS_ML_NN_COMMON_OPERATIONS_INTERNAL_OPTIMIZED_TENSOR_UTILS_IMPL_H_
+#define FRAMEWORKS_ML_NN_COMMON_OPERATIONS_INTERNAL_OPTIMIZED_TENSOR_UTILS_IMPL_H_
+
+#include "ActivationFunctor.h"
+
+#ifndef USE_NEON
+#if defined(__ARM_NEON__) || defined(__ARM_NEON)
+#define USE_NEON
+#endif // defined(__ARM_NEON__) || defined(__ARM_NEON)
+#endif // USE_NEON
+
+namespace android {
+namespace nn {
+namespace tensor_utils {
+
+// Multiply a matrix by a batch vector, and store results in a batch-size
+// vector.
+void PortableMatrixBatchVectorMultiplyAccumulate(const float* matrix,
+ int m_rows, int m_cols,
+ const float* vector,
+ int n_batch, float* result,
+ int result_stride);
+void NeonMatrixBatchVectorMultiplyAccumulate(const float* matrix, int m_rows,
+ int m_cols, const float* vector,
+ int n_batch, float* result,
+ int result_stride);
+
+// Cwise product of two vectors.
+void PortableVectorVectorCwiseProduct(const float* vector1,
+ const float* vector2, int v_size,
+ float* result);
+void NeonVectorVectorCwiseProduct(const float* vector1, const float* vector2,
+ int v_size, float* result);
+
+// Cwise product and accumulate of two vectors. Since it's a MAC operation, the
+// assumption here is that result array is initialized to valid values.
+void PortableVectorVectorCwiseProductAccumulate(const float* vector1,
+ const float* vector2,
+ int v_size, float* result);
+void NeonVectorVectorCwiseProductAccumulate(const float* vector1,
+ const float* vector2, int v_size,
+ float* result);
+
+// Dot product of two vectors.
+float PortableVectorVectorDotProduct(const float* vector1, const float* vector2,
+ int v_size);
+
+// Dot product of two batch vectors.
+void PortableBatchVectorBatchVectorDotProduct(const float* vector1,
+ const float* vector2, int v_size,
+ int n_batch, float* result,
+ int result_stride);
+
+// Cwise product and accumulate of a vector and a batch-vector. Since it's a MAC
+// operation, the assumption here is that result array is initialized to valid
+// values.
+void PortableVectorBatchVectorCwiseProductAccumulate(const float* vector,
+ int v_size,
+ const float* batch_vector,
+ int n_batch,
+ float* result);
+void NeonVectorBatchVectorCwiseProductAccumulate(const float* vector,
+ int v_size,
+ const float* batch_vector,
+ int n_batch, float* result);
+
+// Compute "1.0f - elements of vector" (used in CIFG).
+void PortableSub1Vector(const float* vector, int v_size, float* result);
+void NeonSub1Vector(const float* vector, int v_size, float* result);
+
+// Clip elements of a vector using a abs_limit value.
+void PortableClipVector(const float* vector, int v_size, float abs_limit,
+ float* result);
+void NeonClipVector(const float* vector, int v_size, float abs_limit,
+ float* result);
+
+// Batch vector initialization with another vector.
+void PortableVectorBatchVectorAssign(const float* vector, int v_size,
+ int n_batch, float* batch_vector);
+
+// Apply sigmoid to elements of a vector.
+void PortableApplySigmoidToVector(const float* vector, int v_size,
+ float* result);
+
+// Apply activation function to elements of a vector.
+void PortableApplyActivationToVector(const float* vector, int v_size,
+ ActivationFn activation,
+ float* result);
+
+// Copy vector to another vector.
+void PortableCopyVector(const float* vector, int v_size, float* result);
+
+// Fill vector with 0.f.
+void PortableZeroVector(float* vector, int v_size);
+
+// Limit a float input f between +abs_limit and -abs_limit.
+float PortableClip(float f, float abs_limit);
+
+// Shift left a vector in place with v_size size.
+void PortableVectorShiftLeft(float* vector, int v_size, float shift_value);
+
+// Reduce-sum on a float input vector:
+// input_vector: float pointer to input vector.
+// input_stride: input vector stride.
+// output_vector: float pointer to vector.
+// output_size: output vector size.
+// reduction_size: number of consecutive elements from input vector which are
+// added to get one element of output.
+void PortableReductionSumVector(const float* input_vector, int input_stride,
+ float* output_vector, int output_size,
+ int reduction_size);
+} // namespace tensor_utils
+} // namespace nn
+} // namespace android
+
+#endif // FRAMEWORKS_ML_NN_COMMON_OPERATIONS_INTERNAL_OPTIMIZED_TENSOR_UTILS_IMPL_H_
diff --git a/nn/common/operations/internal/reference/portable_tensor_utils.cc b/nn/common/operations/internal/reference/portable_tensor_utils.cc
new file mode 100644
index 000000000..007113ec3
--- /dev/null
+++ b/nn/common/operations/internal/reference/portable_tensor_utils.cc
@@ -0,0 +1,168 @@
+/*
+ * Copyright 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "ActivationFunctor.h"
+#include "Utils.h"
+
+namespace android {
+namespace nn {
+namespace tensor_utils {
+
+float PortableClip(float f, float abs_limit) {
+ float result = (abs_limit < f) ? abs_limit : f;
+ result = (-abs_limit > result) ? -abs_limit : result;
+ return result;
+}
+
+void PortableMatrixBatchVectorMultiplyAccumulate(const float* matrix,
+ int m_rows, int m_cols,
+ const float* vector,
+ int n_batch, float* result,
+ int result_stride) {
+ float* result_in_batch = result;
+ for (int b = 0; b < n_batch; b++) {
+ const float* matrix_ptr = matrix;
+ for (int r = 0; r < m_rows; r++) {
+ const float* vector_in_batch = vector + b * m_cols;
+ for (int c = 0; c < m_cols; c++) {
+ *result_in_batch += *matrix_ptr++ * *vector_in_batch++;
+ }
+ result_in_batch += result_stride;
+ }
+ }
+}
+
+void PortableVectorVectorCwiseProduct(const float* vector1,
+ const float* vector2, int v_size,
+ float* result) {
+ for (int v = 0; v < v_size; v++) {
+ *result++ = *vector1++ * *vector2++;
+ }
+}
+
+float PortableVectorVectorDotProduct(const float* vector1, const float* vector2,
+ int v_size) {
+ float result = 0.0;
+ for (int v = 0; v < v_size; v++) {
+ result += *vector1++ * *vector2++;
+ }
+ return result;
+}
+
+void PortableBatchVectorBatchVectorDotProduct(const float* vector1,
+ const float* vector2, int v_size,
+ int n_batch, float* result,
+ int result_stride) {
+ float* result_ptr = result;
+ const float* vector1_ptr = vector1;
+ const float* vector2_ptr = vector2;
+ for (int b = 0; b < n_batch; b++) {
+ *result_ptr =
+ PortableVectorVectorDotProduct(vector1_ptr, vector2_ptr, v_size);
+ vector1_ptr += v_size;
+ vector2_ptr += v_size;
+ result_ptr += result_stride;
+ }
+}
+
+void PortableVectorVectorCwiseProductAccumulate(const float* vector1,
+ const float* vector2,
+ int v_size, float* result) {
+ for (int v = 0; v < v_size; v++) {
+ *result++ += *vector1++ * *vector2++;
+ }
+}
+
+void PortableVectorBatchVectorCwiseProductAccumulate(const float* vector,
+ int v_size,
+ const float* batch_vector,
+ int n_batch,
+ float* result) {
+ for (int b = 0; b < n_batch; b++) {
+ for (int v = 0; v < v_size; v++) {
+ *result++ += vector[v] * *batch_vector++;
+ }
+ }
+}
+
+void PortableVectorBatchVectorAssign(const float* vector, int v_size,
+ int n_batch, float* batch_vector) {
+ for (int b = 0; b < n_batch; b++) {
+ memcpy(batch_vector + b * v_size, vector, v_size * sizeof(float));
+ }
+}
+
+void PortableApplySigmoidToVector(const float* vector, int v_size,
+ float* result) {
+ auto sigmoid_func = ActivationFunctor(kActivationSigmoid);
+ for (int v = 0; v < v_size; v++) {
+ *result++ = (sigmoid_func)(*vector++);
+ }
+}
+
+void PortableApplyActivationToVector(const float* vector, int v_size,
+ ActivationFn activation,
+ float* result) {
+ auto activation_func = ActivationFunctor(activation);
+ for (int v = 0; v < v_size; v++) {
+ *result++ = (activation_func)(*vector++);
+ }
+}
+
+void PortableCopyVector(const float* vector, int v_size, float* result) {
+ memcpy(result, vector, v_size * sizeof(float));
+}
+
+void PortableSub1Vector(const float* vector, int v_size, float* result) {
+ for (int v = 0; v < v_size; v++) {
+ *result++ = 1.0f - *vector++;
+ }
+}
+
+void PortableZeroVector(float* vector, int v_size) {
+ memset(vector, 0, v_size * sizeof(float));
+}
+
+void PortableClipVector(const float* vector, int v_size, float abs_limit,
+ float* result) {
+ for (int v = 0; v < v_size; v++) {
+ *result++ = PortableClip(*vector++, abs_limit);
+ }
+}
+
+void PortableVectorShiftLeft(float* vector, int v_size, float shift_value) {
+ nnAssert(v_size > 0);
+ for (int i = 0; i < v_size - 1; i++) {
+ vector[i] = vector[i + 1];
+ }
+ vector[v_size - 1] = shift_value;
+}
+
+void PortableReductionSumVector(const float* input_vector, int input_stride,
+ float* output_vector, int output_size,
+ int reduction_size) {
+ const float* input_vector_ptr = input_vector;
+ for (int o = 0; o < output_size; o++) {
+ for (int r = 0; r < reduction_size; r++) {
+ output_vector[o] += *input_vector_ptr;
+ input_vector_ptr += input_stride;
+ }
+ }
+}
+
+} // namespace tensor_utils
+} // namespace nn
+} // namespace android
diff --git a/nn/common/operations/internal/reference/portable_tensor_utils.h b/nn/common/operations/internal/reference/portable_tensor_utils.h
new file mode 100644
index 000000000..138845e78
--- /dev/null
+++ b/nn/common/operations/internal/reference/portable_tensor_utils.h
@@ -0,0 +1,194 @@
+/*
+ * Copyright 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef FRAMEWORKS_ML_NN_COMMON_OPERATIONS_INTERNAL_REFERENCE_PORTABLE_TENSOR_UTILS_H_
+#define FRAMEWORKS_ML_NN_COMMON_OPERATIONS_INTERNAL_REFERENCE_PORTABLE_TENSOR_UTILS_H_
+
+#include "ActivationFunctor.h"
+
+namespace android {
+namespace nn {
+namespace tensor_utils {
+
+// Limit a float input f betweeen +abs_limit and -abs_limit.
+float PortableClip(float f, float abs_limit);
+
+// Multiply a matrix by a batch vector, and store results in a batch-size
+// vector.
+void PortableMatrixBatchVectorMultiplyAccumulate(const float* matrix,
+ int m_rows, int m_cols,
+ const float* vector,
+ int n_batch, float* result,
+ int result_stride);
+
+// Cwise product of two vectors.
+void PortableVectorVectorCwiseProduct(const float* vector1,
+ const float* vector2, int v_size,
+ float* result);
+
+// Cwise product and accumulate of two vectors. Since it's a MAC opertation, the
+// assumption here is that result array is initialized to valid values.
+void PortableVectorVectorCwiseProductAccumulate(const float* vector1,
+ const float* vector2,
+ int v_size, float* result);
+
+// Dot product of two vectors.
+float PortableVectorVectorDotProduct(const float* vector1, const float* vector2,
+ int v_size);
+
+// Dot product of two batch vectors.
+void PortableBatchVectorBatchVectorDotProduct(const float* vector1,
+ const float* vector2, int v_size,
+ int n_batch, float* result,
+ int result_stride);
+
+// Cwise product and accumulate of a vector and a batch-vector. Since it's a MAC
+// operation, the assumption here is that result array is initialized to valid
+// values.
+void PortableVectorBatchVectorCwiseProductAccumulate(const float* vector,
+ int v_size,
+ const float* batch_vector,
+ int n_batch,
+ float* result);
+
+// Batch vector initialization with another vector.
+void PortableVectorBatchVectorAssign(const float* vector, int v_size,
+ int n_batch, float* batch_vector);
+
+// Apply sigmoid to elements of a vector.
+void PortableApplySigmoidToVector(const float* vector, int v_size,
+ float* result);
+
+// Apply activation function to elements of a vector.
+void PortableApplyActivationToVector(const float* vector, int v_size,
+ ActivationFn activation,
+ float* result);
+
+// Copy vector to another vector.
+void PortableCopyVector(const float* vector, int v_size, float* result);
+
+// Compute "1.0f - elements of vector" (used in CIFG).
+void PortableSub1Vector(const float* vector, int v_size, float* result);
+
+// Fill vector with 0.f.
+void PortableZeroVector(float* vector, int v_size);
+
+// Clip elements of a vector using a abs_limit value.
+void PortableClipVector(const float* vector, int v_size, float abs_limit,
+ float* result);
+
+// Shift left a vector in place with v_size size.
+void PortableVectorShiftLeft(float* vector, int v_size, float shift_value);
+
+// Reduce-sum on a float input vector:
+// input_vector: float pointer to input vector.
+// input_stride: input vector stride.
+// output_vector: float pointer to vector.
+// output_size: output vector size.
+// reduction_size: number of consecutive elements from input vector which are
+// added to get one element of output.
+void PortableReductionSumVector(const float* input_vector, int input_stride,
+ float* output_vector, int output_size,
+ int reduction_size);
+
+float Clip(float f, float abs_limit) { return PortableClip(f, abs_limit); }
+
+void MatrixBatchVectorMultiplyAccumulate(const float* matrix, int m_rows,
+ int m_cols, const float* vector,
+ int n_batch, float* result,
+ int result_stride) {
+ PortableMatrixBatchVectorMultiplyAccumulate(matrix, m_rows, m_cols, vector,
+ n_batch, result, result_stride);
+}
+
+void VectorVectorCwiseProduct(const float* vector1, const float* vector2,
+ int v_size, float* result) {
+ PortableVectorVectorCwiseProduct(vector1, vector2, v_size, result);
+}
+
+void VectorVectorCwiseProductAccumulate(const float* vector1,
+ const float* vector2, int v_size,
+ float* result) {
+ PortableVectorVectorCwiseProductAccumulate(vector1, vector2, v_size, result);
+}
+
+void VectorBatchVectorCwiseProductAccumulate(const float* vector, int v_size,
+ const float* batch_vector,
+ int n_batch, float* result) {
+ PortableVectorBatchVectorCwiseProductAccumulate(vector, v_size, batch_vector,
+ n_batch, result);
+}
+
+float VectorVectorDotProduct(const float* vector1, const float* vector2,
+ int v_size) {
+ return PortableVectorVectorDotProduct(vector1, vector2, v_size);
+}
+
+void BatchVectorBatchVectorDotProduct(const float* vector1,
+ const float* vector2, int v_size,
+ int n_batch, float* result,
+ int result_stride) {
+ PortableBatchVectorBatchVectorDotProduct(vector1, vector2, v_size, n_batch,
+ result, result_stride);
+}
+
+void VectorBatchVectorAssign(const float* vector, int v_size, int n_batch,
+ float* batch_vector) {
+ PortableVectorBatchVectorAssign(vector, v_size, n_batch, batch_vector);
+}
+
+void ApplySigmoidToVector(const float* vector, int v_size, float* result) {
+ PortableApplySigmoidToVector(vector, v_size, result);
+}
+
+void ApplyActivationToVector(const float* vector, int v_size,
+ ActivationFn activation, float* result) {
+ PortableApplyActivationToVector(vector, v_size, activation, result);
+}
+
+void CopyVector(const float* vector, int v_size, float* result) {
+ PortableCopyVector(vector, v_size, result);
+}
+
+void Sub1Vector(const float* vector, int v_size, float* result) {
+ PortableSub1Vector(vector, v_size, result);
+}
+
+void ZeroVector(float* vector, int v_size) {
+ PortableZeroVector(vector, v_size);
+}
+
+void ClipVector(const float* vector, int v_size, float abs_limit,
+ float* result) {
+ PortableClipVector(vector, v_size, abs_limit, result);
+}
+
+void VectorShiftLeft(float* vector, int v_size, float shift_value) {
+ PortableVectorShiftLeft(vector, v_size, shift_value);
+}
+
+void ReductionSumVector(const float* input_vector, int input_stride,
+ float* output_vector, int output_size,
+ int reduction_size) {
+ PortableReductionSumVector(input_vector, input_stride, output_vector,
+ output_size, reduction_size);
+}
+
+} // namespace tensor_utils
+} // namespace nn
+} // namespace android
+
+#endif // FRAMEWORKS_ML_NN_COMMON_OPERATIONS_INTERNAL_REFERENCE_PORTABLE_TENSOR_UTILS_H_
diff --git a/nn/common/operations/internal/tensor_utils.cc b/nn/common/operations/internal/tensor_utils.cc
new file mode 100644
index 000000000..78275bb29
--- /dev/null
+++ b/nn/common/operations/internal/tensor_utils.cc
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "tensor_utils.h"
+
+#ifndef USE_NEON
+#if defined(__ARM_NEON__) || defined(__ARM_NEON)
+#define USE_NEON
+#endif // defined(__ARM_NEON__) || defined(__ARM_NEON)
+#endif // USE_NEON
+
+#ifdef USE_NEON
+#include "optimized/neon_tensor_utils.h"
+#else
+#include "reference/portable_tensor_utils.h"
+#endif // USE_NEON
diff --git a/nn/common/operations/internal/tensor_utils.h b/nn/common/operations/internal/tensor_utils.h
new file mode 100644
index 000000000..56167d2b1
--- /dev/null
+++ b/nn/common/operations/internal/tensor_utils.h
@@ -0,0 +1,122 @@
+/*
+ * Copyright 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef FRAMEWORKS_ML_NN_COMMON_OPERATIONS_INTERNAL_TENSOR_UTILS_H_
+#define FRAMEWORKS_ML_NN_COMMON_OPERATIONS_INTERNAL_TENSOR_UTILS_H_
+
+#include "ActivationFunctor.h"
+
+namespace android {
+namespace nn {
+namespace tensor_utils {
+
+// Limit a float input f betweeen +abs_limit and -abs_limit.
+float Clip(float f, float abs_limit);
+
+// Multiply a matrix by a batch vector, and store results in a batch-size
+// vector using a stride value provided in result_stride. 'result_stride' shows
+// how the number of elements between consecutive result values. For example
+// result_stride = 1, will cause the output to look like this:
+// [O_1, 0_2, ... O_rows] in memory, but result_stride = 3, will cause it to be
+// arranged like this in memory: [O_1, x, x, 0_2, x, x, ..., O_rows]
+void MatrixBatchVectorMultiplyAccumulate(const float* matrix, int m_rows,
+ int m_cols, const float* vector,
+ int n_batch, float* result,
+ int result_stride);
+
+// Cwise product of two vectors.
+void VectorVectorCwiseProduct(const float* vector1, const float* vector2,
+ int v_size, float* result);
+
+// Cwise product and accumulate of two vectors. Since it's a MAC opertation, the
+// assumption here is that result array is initialized to valid values.
+void VectorVectorCwiseProductAccumulate(const float* vector1,
+ const float* vector2, int v_size,
+ float* result);
+
+// Dot product of two vectors.
+float VectorVectorDotProduct(const float* vector1, const float* vector2,
+ int v_size);
+
+// Dot product of two batch vectors of size n_batch * v_size:
+// vector1 = [x_1_1, x_1_2, ..., x_1_vsize,
+// x_2_1, x_2_2, ..., x_2_vsize,
+// ...
+// x_nbatch_1,..., x_nbatch_vsize]
+// vector2 = [y_1_1, y_1_2, ..., y_1_vsize,
+// y_2_1, y_2_2, ..., y_2_vsize,
+// ...
+// y_nbatch_1,..., y_nbatch_vsize]
+// Then result will be a vector of n_batch size which will be saved with a
+// stride of result_stride in memory starting from 'result':
+// [x_1_1 * y_1_1 + x_1_2 * y_1_2 + ... + x_1_vsize * y_1_vsize,
+// x_2_1 * y_2_1 + x_2_2 * y_2_2 + ... + x_2_vsize * y_2_vsize,
+// ...
+// x_nbatch_1 * y_nbatch_1 + ... + x_nbatch_vsize * y_nbatch_vsize]
+void BatchVectorBatchVectorDotProduct(const float* vector1,
+ const float* vector2, int v_size,
+ int n_batch, float* result,
+ int result_stride);
+
+// Cwise product and accumulate of a vector and a batch-vector. Since it's a MAC
+// operation, the assumption here is that result array is initialized to valid
+// values.
+void VectorBatchVectorCwiseProductAccumulate(const float* vector, int v_size,
+ const float* batch_vector,
+ int n_batch, float* result);
+
+// Batch vector initialization with another vector.
+void VectorBatchVectorAssign(const float* vector, int v_size, int n_batch,
+ float* batch_vector);
+
+// Apply sigmoid to elements of a vector.
+void ApplySigmoidToVector(const float* vector, int v_size, float* result);
+
+// Apply activation function to elements of a vector.
+void ApplyActivationToVector(const float* vector, int v_size,
+ ActivationFn activation, float* result);
+
+// Copy vector to another vector.
+void CopyVector(const float* vector, int v_size, float* result);
+
+// Compute "1.0f - elements of vector" (used in CIFG).
+void Sub1Vector(const float* vector, int v_size, float* result);
+
+// Fill vector with 0.f.
+void ZeroVector(float* vector, int v_size);
+
+// Clip elements of a vector using a abs_limit value.
+void ClipVector(const float* vector, int v_size, float abs_limit,
+ float* result);
+
+// Shift left a vector in place with v_size size.
+void VectorShiftLeft(float* vector, int v_size, float shift_value);
+
+// Reduce-sum on a float input vector:
+// input_vector: float pointer to input vector.
+// input_stride: input vector stride.
+// output_vector: float pointer to vector.
+// output_size: output vector size.
+// reduction_size: number of consecutive elements from input vector which are
+// added to get one element of output.
+void ReductionSumVector(const float* input_vector, int input_stride,
+ float* output_vector, int output_size,
+ int reduction_size);
+} // namespace tensor_utils
+} // namespace nn
+} // namespace android
+
+#endif // FRAMEWORKS_ML_NN_COMMON_OPERATIONS_INTERNAL_TENSOR_UTILS_H_
diff --git a/nn/common/operations/internal/tensor_utils_test.cc b/nn/common/operations/internal/tensor_utils_test.cc
new file mode 100644
index 000000000..ad5204d0c
--- /dev/null
+++ b/nn/common/operations/internal/tensor_utils_test.cc
@@ -0,0 +1,197 @@
+/*
+ * Copyright 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "gmock/gmock-matchers.h"
+#include "gtest/gtest.h"
+#include "tensor_utils.h"
+
+namespace android {
+namespace nn {
+namespace tensor_utils {
+
+namespace {
+
+using ::testing::FloatNear;
+using ::testing::Matcher;
+
+std::vector<Matcher<float>> ArrayFloatNear(const std::vector<float>& values,
+ float max_abs_error=1.e-6) {
+ std::vector<Matcher<float>> matchers;
+ matchers.reserve(values.size());
+ for (const float& v : values) {
+ matchers.emplace_back(FloatNear(v, max_abs_error));
+ }
+ return matchers;
+}
+
+} // anonymous namespace
+
+TEST(uKernels, ClipTest) {
+ constexpr int kVectorSize = 10;
+ constexpr float kAbsLimit = 2.0;
+ static float input[kVectorSize] = {0.0, -0.5, 1.0, -1.5, 2.0,
+ -2.5, 3.0, -3.5, 4.0, -4.5};
+ std::vector<float> output(kVectorSize);
+ ClipVector(input, kVectorSize, kAbsLimit, output.data());
+ EXPECT_THAT(output,
+ ElementsAreArray(ArrayFloatNear(
+ {0.0, -0.5, 1.0, -1.5, 2.0, -2.0, 2.0, -2.0, 2.0, -2.0})));
+}
+
+TEST(uKernels, MatrixBatchVectorMultiplyAccumulateTest) {
+ constexpr int kRow = 3;
+ constexpr int kCol = 4;
+ constexpr int kBatch = 2;
+ static float matrix[kRow * kCol] = {1.0, 2.0, 3.0, 4.0, //
+ -1.0, -2.0, -3.0, -4.0, //
+ 1.0, -2.0, 3.0, -4.0};
+ static float vector[kCol * kBatch] = {1.0, -1.0, 1.0, -1.0, //
+ 2.0, -2.0, 2.0, -2.0};
+ std::vector<float> output(kRow * kBatch);
+ std::fill(output.begin(), output.end(), 3.0);
+ MatrixBatchVectorMultiplyAccumulate(matrix, kRow, kCol, vector, kBatch,
+ output.data(), /*result_stride=*/1);
+ EXPECT_THAT(output, ElementsAreArray(ArrayFloatNear({1., 5., 13., //
+ -1., 7., 23.})));
+}
+
+TEST(uKernels, VectorVectorCwiseProductTest) {
+ constexpr int kVectorSize = 10;
+ static float input1[kVectorSize] = {0.0, -0.5, 1.0, -1.5, 2.0,
+ -2.5, 3.0, -3.5, 4.0, -4.5};
+ static float input2[kVectorSize] = {0.1, -0.1, 0.1, -0.1, 0.1,
+ -0.1, 0.1, -0.1, 0.1, -0.1};
+ std::vector<float> output(kVectorSize);
+ VectorVectorCwiseProduct(input1, input2, kVectorSize, output.data());
+ EXPECT_THAT(output,
+ ElementsAreArray(ArrayFloatNear(
+ {0.0, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45})));
+}
+
+TEST(uKernels, VectorVectorCwiseProductAccumulateTest) {
+ constexpr int kVectorSize = 10;
+ static float input1[kVectorSize] = {0.0, -0.5, 1.0, -1.5, 2.0,
+ -2.5, 3.0, -3.5, 4.0, -4.5};
+ static float input2[kVectorSize] = {0.1, -0.1, 0.1, -0.1, 0.1,
+ -0.1, 0.1, -0.1, 0.1, -0.1};
+ std::vector<float> output(kVectorSize);
+ std::fill(output.begin(), output.end(), 1.0);
+ VectorVectorCwiseProductAccumulate(input1, input2, kVectorSize,
+ output.data());
+ EXPECT_THAT(output,
+ ElementsAreArray(ArrayFloatNear(
+ {1.0, 1.05, 1.1, 1.15, 1.2, 1.25, 1.3, 1.35, 1.4, 1.45})));
+}
+
+TEST(uKernels, VectorBatchVectorAssignTest) {
+ constexpr int kVectorSize = 5;
+ constexpr int kBatchSize = 3;
+ static float input[kVectorSize] = {0.0, -0.5, 1.0, -1.5, 2.0};
+ std::vector<float> output(kVectorSize * kBatchSize);
+ VectorBatchVectorAssign(input, kVectorSize, kBatchSize, output.data());
+ EXPECT_THAT(output, ElementsAreArray(ArrayFloatNear(
+ {0.0, -0.5, 1.0, -1.5, 2.0, 0.0, -0.5, 1.0, -1.5, 2.0,
+ 0.0, -0.5, 1.0, -1.5, 2.0})));
+}
+
+TEST(uKernels, ApplySigmoidToVectorTest) {
+ constexpr int kVectorSize = 5;
+ static float input[kVectorSize] = {0.0, -0.5, 1.0, -1.5, 2.0};
+ std::vector<float> output(kVectorSize);
+ ApplySigmoidToVector(input, kVectorSize, output.data());
+ EXPECT_THAT(output, ElementsAreArray(ArrayFloatNear(
+ {0.5, 0.377541, 0.731059, 0.182426, 0.880797})));
+}
+
+TEST(uKernels, ApplyActivationToVectorTest) {
+ constexpr int kVectorSize = 5;
+ static float input[kVectorSize] = {0.0, -0.5, 1.0, -1.5, 2.0};
+ std::vector<float> output(kVectorSize);
+ ApplyActivationToVector(input, kVectorSize, kActivationRelu, output.data());
+ EXPECT_THAT(output,
+ ElementsAreArray(ArrayFloatNear({0.0, 0.0, 1.0, 0.0, 2.0})));
+
+ ApplyActivationToVector(input, kVectorSize, kActivationTanh, output.data());
+ EXPECT_THAT(output, ElementsAreArray(ArrayFloatNear(
+ {0.0, -0.462117, 0.761594, -0.905148, 0.964028})));
+}
+
+TEST(uKernels, CopyVectorTest) {
+ constexpr int kVectorSize = 5;
+ static float input[kVectorSize] = {0.0, -0.5, 1.0, -1.5, 2.0};
+ std::vector<float> output(kVectorSize);
+ CopyVector(input, kVectorSize, output.data());
+ EXPECT_THAT(output,
+ ElementsAreArray(ArrayFloatNear({0.0, -0.5, 1.0, -1.5, 2.0})));
+}
+
+TEST(uKernels, Sub1VectorTest) {
+ constexpr int kVectorSize = 5;
+ static float input[kVectorSize] = {0.0, -0.5, 1.0, -1.5, 2.0};
+ std::vector<float> output(kVectorSize);
+ Sub1Vector(input, kVectorSize, output.data());
+ EXPECT_THAT(output,
+ ElementsAreArray(ArrayFloatNear({1.0, 1.5, 0.0, 2.5, -1.0})));
+}
+
+TEST(uKernels, ZeroVectorTest) {
+ constexpr int kVectorSize = 5;
+ std::vector<float> output(kVectorSize);
+ ZeroVector(output.data(), kVectorSize);
+ EXPECT_THAT(output,
+ ElementsAreArray(ArrayFloatNear({0.0, 0.0, 0.0, 0.0, 0.0})));
+}
+
+TEST(uKernels, BatchVectorBatchVectorDotProductTest) {
+ constexpr int kVectorSize = 5;
+ constexpr int kBatch = 2;
+ static float input1[kVectorSize * kBatch] = {0.0, -0.5, 1.0, -1.5, 2.0,
+ -2.5, 3.0, -3.5, 4.0, -4.5};
+ static float input2[kVectorSize * kBatch] = {0.1, -0.1, 0.1, -0.1, 0.1,
+ -0.1, 0.1, -0.1, 0.1, -0.1};
+ std::vector<float> output(kBatch);
+ BatchVectorBatchVectorDotProduct(input1, input2, kVectorSize, kBatch,
+ output.data(), /*result_stride=*/1);
+ EXPECT_THAT(output, ElementsAreArray(ArrayFloatNear({0.5, 1.75})));
+}
+
+TEST(uKernels, VectorShiftLeftTest) {
+ constexpr int kVectorSize = 5;
+ static float input[kVectorSize] = {0.0, -0.5, 1.0, -1.5, 2.0};
+ std::vector<float> result(kVectorSize);
+ VectorShiftLeft(input, kVectorSize, 3.0);
+ result.assign(input, input + kVectorSize);
+ EXPECT_THAT(result,
+ ElementsAreArray(ArrayFloatNear({-0.5, 1.0, -1.5, 2.0, 3.0})));
+}
+
+TEST(uKernels, ReductionSumVectorTest) {
+ constexpr int kInputVectorSize = 10;
+ constexpr int kOutputVectorSize = 5;
+ constexpr int kReductionSize = 2;
+ static float input[kInputVectorSize] = {0.0, -0.5, 1.0, -1.5, 2.0,
+ 0.0, -0.5, 1.0, 1.0, 2.0};
+ std::vector<float> result(kOutputVectorSize);
+ ReductionSumVector(input,
+ /*input_stride=*/1, result.data(), kOutputVectorSize,
+ kReductionSize);
+ EXPECT_THAT(result,
+ ElementsAreArray(ArrayFloatNear({-0.5, -0.5, 2.0, 0.5, 3.0})));
+}
+
+} // namespace tensor_utils
+} // namespace nn
+} // namespace android
diff --git a/nn/driver/sample/SampleDriverAll.cpp b/nn/driver/sample/SampleDriverAll.cpp
index 3e29481f3..5ddaaec52 100644
--- a/nn/driver/sample/SampleDriverAll.cpp
+++ b/nn/driver/sample/SampleDriverAll.cpp
@@ -37,6 +37,7 @@ public:
};
Return<void> SampleDriverAll::getCapabilities(getCapabilities_cb cb) {
+ android::nn::initVLogMask();
VLOG(DRIVER) << "getCapabilities()";
Capabilities capabilities = {.float32Performance = {.execTime = 1.1f, .powerUsage = 1.1f},
.quantized8Performance = {.execTime = 1.1f, .powerUsage = 1.1f}};
@@ -66,7 +67,6 @@ using android::nn::sample_driver::SampleDriverAll;
using android::sp;
int main() {
- android::nn::initVLogMask();
sp<SampleDriverAll> driver(new SampleDriverAll());
return driver->run();
}
diff --git a/nn/driver/sample/SampleDriverFloatFast.cpp b/nn/driver/sample/SampleDriverFloatFast.cpp
index 4a2b74963..cf416297d 100644
--- a/nn/driver/sample/SampleDriverFloatFast.cpp
+++ b/nn/driver/sample/SampleDriverFloatFast.cpp
@@ -37,6 +37,7 @@ public:
};
Return<void> SampleDriverFloatFast::getCapabilities(getCapabilities_cb cb) {
+ android::nn::initVLogMask();
VLOG(DRIVER) << "getCapabilities()";
Capabilities capabilities = {.float32Performance = {.execTime = 0.8f, .powerUsage = 1.2f},
.quantized8Performance = {.execTime = 1.0f, .powerUsage = 1.0f}};
@@ -73,7 +74,6 @@ using android::nn::sample_driver::SampleDriverFloatFast;
using android::sp;
int main() {
- android::nn::initVLogMask();
sp<SampleDriverFloatFast> driver(new SampleDriverFloatFast());
return driver->run();
}
diff --git a/nn/driver/sample/SampleDriverFloatSlow.cpp b/nn/driver/sample/SampleDriverFloatSlow.cpp
index f472b9b11..87ed39944 100644
--- a/nn/driver/sample/SampleDriverFloatSlow.cpp
+++ b/nn/driver/sample/SampleDriverFloatSlow.cpp
@@ -37,6 +37,7 @@ public:
};
Return<void> SampleDriverFloatSlow::getCapabilities(getCapabilities_cb cb) {
+ android::nn::initVLogMask();
VLOG(DRIVER) << "getCapabilities()";
Capabilities capabilities = {.float32Performance = {.execTime = 1.3f, .powerUsage = 0.7f},
.quantized8Performance = {.execTime = 1.0f, .powerUsage = 1.0f}};
@@ -73,7 +74,6 @@ using android::nn::sample_driver::SampleDriverFloatSlow;
using android::sp;
int main() {
- android::nn::initVLogMask();
sp<SampleDriverFloatSlow> driver(new SampleDriverFloatSlow());
return driver->run();
}
diff --git a/nn/driver/sample/SampleDriverMinimal.cpp b/nn/driver/sample/SampleDriverMinimal.cpp
index 919ac1cd4..0b6500078 100644
--- a/nn/driver/sample/SampleDriverMinimal.cpp
+++ b/nn/driver/sample/SampleDriverMinimal.cpp
@@ -38,6 +38,7 @@ public:
};
Return<void> SampleDriverMinimal::getCapabilities(getCapabilities_cb cb) {
+ android::nn::initVLogMask();
VLOG(DRIVER) << "getCapabilities()";
Capabilities capabilities = {.float32Performance = {.execTime = 0.4f, .powerUsage = 0.5f},
.quantized8Performance = {.execTime = 1.0f, .powerUsage = 1.0f}};
@@ -85,7 +86,6 @@ using android::nn::sample_driver::SampleDriverMinimal;
using android::sp;
int main() {
- android::nn::initVLogMask();
sp<SampleDriverMinimal> driver(new SampleDriverMinimal());
return driver->run();
}
diff --git a/nn/driver/sample/SampleDriverQuant.cpp b/nn/driver/sample/SampleDriverQuant.cpp
index 269541691..25b07d2a5 100644
--- a/nn/driver/sample/SampleDriverQuant.cpp
+++ b/nn/driver/sample/SampleDriverQuant.cpp
@@ -37,6 +37,7 @@ public:
};
Return<void> SampleDriverQuant::getCapabilities(getCapabilities_cb cb) {
+ android::nn::initVLogMask();
VLOG(DRIVER) << "getCapabilities()";
Capabilities capabilities = {.float32Performance = {.execTime = 50.0f, .powerUsage = 1.0f},
.quantized8Performance = {.execTime = 50.0f, .powerUsage = 1.0f}};
@@ -73,7 +74,6 @@ using android::nn::sample_driver::SampleDriverQuant;
using android::sp;
int main() {
- android::nn::initVLogMask();
sp<SampleDriverQuant> driver(new SampleDriverQuant());
return driver->run();
}
diff --git a/nn/runtime/test/generated/all_generated_tests.cpp b/nn/runtime/test/generated/all_generated_tests.cpp
index 58d6cd6d5..7b59f0535 100644
--- a/nn/runtime/test/generated/all_generated_tests.cpp
+++ b/nn/runtime/test/generated/all_generated_tests.cpp
@@ -1051,6 +1051,34 @@ TEST_F(GeneratedTests, lstm2) {
lstm2::examples);
}
+namespace lstm2_state2 {
+std::vector<MixedTypedExample> examples = {
+// Generated lstm2_state2 test
+#include "generated/examples/lstm2_state2.example.cpp"
+};
+// Generated model constructor
+#include "generated/models/lstm2_state2.model.cpp"
+} // namespace lstm2_state2
+TEST_F(GeneratedTests, lstm2_state2) {
+ Execute(lstm2_state2::CreateModel,
+ lstm2_state2::is_ignored,
+ lstm2_state2::examples);
+}
+
+namespace lstm2_state {
+std::vector<MixedTypedExample> examples = {
+// Generated lstm2_state test
+#include "generated/examples/lstm2_state.example.cpp"
+};
+// Generated model constructor
+#include "generated/models/lstm2_state.model.cpp"
+} // namespace lstm2_state
+TEST_F(GeneratedTests, lstm2_state) {
+ Execute(lstm2_state::CreateModel,
+ lstm2_state::is_ignored,
+ lstm2_state::examples);
+}
+
namespace lstm3 {
std::vector<MixedTypedExample> examples = {
// Generated lstm3 test
@@ -1065,6 +1093,48 @@ TEST_F(GeneratedTests, lstm3) {
lstm3::examples);
}
+namespace lstm3_state2 {
+std::vector<MixedTypedExample> examples = {
+// Generated lstm3_state2 test
+#include "generated/examples/lstm3_state2.example.cpp"
+};
+// Generated model constructor
+#include "generated/models/lstm3_state2.model.cpp"
+} // namespace lstm3_state2
+TEST_F(GeneratedTests, lstm3_state2) {
+ Execute(lstm3_state2::CreateModel,
+ lstm3_state2::is_ignored,
+ lstm3_state2::examples);
+}
+
+namespace lstm3_state3 {
+std::vector<MixedTypedExample> examples = {
+// Generated lstm3_state3 test
+#include "generated/examples/lstm3_state3.example.cpp"
+};
+// Generated model constructor
+#include "generated/models/lstm3_state3.model.cpp"
+} // namespace lstm3_state3
+TEST_F(GeneratedTests, lstm3_state3) {
+ Execute(lstm3_state3::CreateModel,
+ lstm3_state3::is_ignored,
+ lstm3_state3::examples);
+}
+
+namespace lstm3_state {
+std::vector<MixedTypedExample> examples = {
+// Generated lstm3_state test
+#include "generated/examples/lstm3_state.example.cpp"
+};
+// Generated model constructor
+#include "generated/models/lstm3_state.model.cpp"
+} // namespace lstm3_state
+TEST_F(GeneratedTests, lstm3_state) {
+ Execute(lstm3_state::CreateModel,
+ lstm3_state::is_ignored,
+ lstm3_state::examples);
+}
+
namespace lstm {
std::vector<MixedTypedExample> examples = {
// Generated lstm test
@@ -1079,6 +1149,34 @@ TEST_F(GeneratedTests, lstm) {
lstm::examples);
}
+namespace lstm_state2 {
+std::vector<MixedTypedExample> examples = {
+// Generated lstm_state2 test
+#include "generated/examples/lstm_state2.example.cpp"
+};
+// Generated model constructor
+#include "generated/models/lstm_state2.model.cpp"
+} // namespace lstm_state2
+TEST_F(GeneratedTests, lstm_state2) {
+ Execute(lstm_state2::CreateModel,
+ lstm_state2::is_ignored,
+ lstm_state2::examples);
+}
+
+namespace lstm_state {
+std::vector<MixedTypedExample> examples = {
+// Generated lstm_state test
+#include "generated/examples/lstm_state.example.cpp"
+};
+// Generated model constructor
+#include "generated/models/lstm_state.model.cpp"
+} // namespace lstm_state
+TEST_F(GeneratedTests, lstm_state) {
+ Execute(lstm_state::CreateModel,
+ lstm_state::is_ignored,
+ lstm_state::examples);
+}
+
namespace max_pool_float_1 {
std::vector<MixedTypedExample> examples = {
// Generated max_pool_float_1 test
@@ -1485,6 +1583,20 @@ TEST_F(GeneratedTests, rnn) {
rnn::examples);
}
+namespace rnn_state {
+std::vector<MixedTypedExample> examples = {
+// Generated rnn_state test
+#include "generated/examples/rnn_state.example.cpp"
+};
+// Generated model constructor
+#include "generated/models/rnn_state.model.cpp"
+} // namespace rnn_state
+TEST_F(GeneratedTests, rnn_state) {
+ Execute(rnn_state::CreateModel,
+ rnn_state::is_ignored,
+ rnn_state::examples);
+}
+
namespace softmax_float_1 {
std::vector<MixedTypedExample> examples = {
// Generated softmax_float_1 test
@@ -1625,6 +1737,20 @@ TEST_F(GeneratedTests, svdf) {
svdf::examples);
}
+namespace svdf_state {
+std::vector<MixedTypedExample> examples = {
+// Generated svdf_state test
+#include "generated/examples/svdf_state.example.cpp"
+};
+// Generated model constructor
+#include "generated/models/svdf_state.model.cpp"
+} // namespace svdf_state
+TEST_F(GeneratedTests, svdf_state) {
+ Execute(svdf_state::CreateModel,
+ svdf_state::is_ignored,
+ svdf_state::examples);
+}
+
namespace tanh {
std::vector<MixedTypedExample> examples = {
// Generated tanh test
@@ -1638,3 +1764,4 @@ TEST_F(GeneratedTests, tanh) {
tanh::is_ignored,
tanh::examples);
}
+
diff --git a/nn/runtime/test/generated/examples/lstm.example.cpp b/nn/runtime/test/generated/examples/lstm.example.cpp
index b5313fad1..33a2b19c3 100644
--- a/nn/runtime/test/generated/examples/lstm.example.cpp
+++ b/nn/runtime/test/generated/examples/lstm.example.cpp
@@ -13,7 +13,7 @@
//Output(s)
{ // See tools/test_generator/include/TestHarness.h:MixedTyped
// int -> FLOAT32 map
- {{1, {0, 0, 0, 0}}, {2, {0, 0, 0, 0}}, {3, {-0.02973187f, 0.1229473f, 0.20885126f, -0.15358765f}}, {0, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}},
+ {{1, {-0.0297319f, 0.122947f, 0.208851f, -0.153588f}}, {2, {-0.145439f, 0.157475f, 0.293663f, -0.277353f}}, {3, {-0.02973187f, 0.1229473f, 0.20885126f, -0.15358765f}}, {0, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}},
// int -> INT32 map
{},
// int -> QUANT8_ASYMM map
diff --git a/nn/runtime/test/generated/examples/lstm2.example.cpp b/nn/runtime/test/generated/examples/lstm2.example.cpp
index 619cad0cd..7f1009482 100644
--- a/nn/runtime/test/generated/examples/lstm2.example.cpp
+++ b/nn/runtime/test/generated/examples/lstm2.example.cpp
@@ -13,7 +13,7 @@
//Output(s)
{ // See tools/test_generator/include/TestHarness.h:MixedTyped
// int -> FLOAT32 map
- {{1, {0, 0, 0, 0}}, {2, {0, 0, 0, 0}}, {3, {-0.36444446f, -0.00352185f, 0.12886585f, -0.05163646f}}, {0, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}},
+ {{1, {-0.364445f, -0.00352185f, 0.128866f, -0.0516365f}}, {2, {-0.760444f, -0.0180416f, 0.182264f, -0.0649371f}}, {3, {-0.36444446f, -0.00352185f, 0.12886585f, -0.05163646f}}, {0, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}},
// int -> INT32 map
{},
// int -> QUANT8_ASYMM map
diff --git a/nn/runtime/test/generated/examples/lstm2_state.example.cpp b/nn/runtime/test/generated/examples/lstm2_state.example.cpp
new file mode 100644
index 000000000..ff9f90948
--- /dev/null
+++ b/nn/runtime/test/generated/examples/lstm2_state.example.cpp
@@ -0,0 +1,22 @@
+// Generated file (from: lstm2_state.mod.py). Do not edit
+// Begin of an example
+{
+//Input(s)
+{ // See tools/test_generator/include/TestHarness.h:MixedTyped
+ // int -> FLOAT32 map
+ {{0, {3.0f, 4.0f}}, {1, {}}, {2, {-0.55291498f, -0.42866567f, 0.13056988f, -0.3633365f, -0.22755712f, 0.28253698f, 0.24407166f, 0.33826375f}}, {3, {-0.49770179f, -0.27711356f, -0.09624726f, 0.05100781f, 0.04717243f, 0.48944736f, -0.38535351f, -0.17212132f}}, {4, {0.10725588f, -0.02335852f, -0.55932593f, -0.09426838f, -0.44257352f, 0.54939759f, 0.01533556f, 0.42751634f}}, {5, {}}, {6, {-0.13832897f, -0.0515101f, -0.2359007f, -0.16661474f, -0.14340827f, 0.36986142f, 0.23414481f, 0.55899f, 0.10798943f, -0.41174671f, 0.17751795f, -0.34484994f, -0.35874045f, -0.11352962f, 0.27268326f, 0.54058349f}}, {7, {0.54066205f, -0.32668582f, -0.43562764f, -0.56094903f, 0.42957711f, 0.01841056f, -0.32764608f, -0.33027974f, -0.10826075f, 0.20675004f, 0.19069612f, -0.03026325f, -0.54532051f, 0.33003211f, 0.44901288f, 0.21193194f}}, {8, {0.41613156f, 0.42610586f, -0.16495961f, -0.5663873f, 0.30579174f, -0.05115908f, -0.33941799f, 0.23364776f, 0.11178309f, 0.09481031f, -0.26424935f, 0.46261835f, 0.50248802f, 0.26114327f, -0.43736315f, 0.33149987f}}, {9, {}}, {10, {0.47485286f, -0.51955009f, -0.24458408f, 0.31544167f}}, {11, {-0.17135078f, 0.82760304f, 0.85573703f, -0.77109635f}}, {12, {}}, {13, {1.0f, 1.0f, 1.0f, 1.0f}}, {14, {0.0f, 0.0f, 0.0f, 0.0f}}, {15, {0.0f, 0.0f, 0.0f, 0.0f}}, {16, {}}, {17, {}}, {18, {-0.364445f, -0.00352185f, 0.128866f, -0.0516365f}}, {19, {-0.760444f, -0.0180416f, 0.182264f, -0.0649371f}}, {21, {0.0f}}, {22, {0.0f}}},
+ // int -> INT32 map
+ {{20, {4}}},
+ // int -> QUANT8_ASYMM map
+ {}
+},
+//Output(s)
+{ // See tools/test_generator/include/TestHarness.h:MixedTyped
+ // int -> FLOAT32 map
+ {{1, {-0.423122f, -0.0121822f, 0.24201f, -0.0812458f}}, {2, {-0.978419f, -0.139203f, 0.338163f, -0.0983904f}}, {3, {-0.42312205f, -0.01218222f, 0.24201041f, -0.08124574f}}, {0, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}},
+ // int -> INT32 map
+ {},
+ // int -> QUANT8_ASYMM map
+ {}
+}
+}, // End of an example
diff --git a/nn/runtime/test/generated/examples/lstm2_state2.example.cpp b/nn/runtime/test/generated/examples/lstm2_state2.example.cpp
new file mode 100644
index 000000000..b49e6f627
--- /dev/null
+++ b/nn/runtime/test/generated/examples/lstm2_state2.example.cpp
@@ -0,0 +1,22 @@
+// Generated file (from: lstm2_state2.mod.py). Do not edit
+// Begin of an example
+{
+//Input(s)
+{ // See tools/test_generator/include/TestHarness.h:MixedTyped
+ // int -> FLOAT32 map
+ {{0, {1.0f, 1.0f}}, {1, {}}, {2, {-0.55291498f, -0.42866567f, 0.13056988f, -0.3633365f, -0.22755712f, 0.28253698f, 0.24407166f, 0.33826375f}}, {3, {-0.49770179f, -0.27711356f, -0.09624726f, 0.05100781f, 0.04717243f, 0.48944736f, -0.38535351f, -0.17212132f}}, {4, {0.10725588f, -0.02335852f, -0.55932593f, -0.09426838f, -0.44257352f, 0.54939759f, 0.01533556f, 0.42751634f}}, {5, {}}, {6, {-0.13832897f, -0.0515101f, -0.2359007f, -0.16661474f, -0.14340827f, 0.36986142f, 0.23414481f, 0.55899f, 0.10798943f, -0.41174671f, 0.17751795f, -0.34484994f, -0.35874045f, -0.11352962f, 0.27268326f, 0.54058349f}}, {7, {0.54066205f, -0.32668582f, -0.43562764f, -0.56094903f, 0.42957711f, 0.01841056f, -0.32764608f, -0.33027974f, -0.10826075f, 0.20675004f, 0.19069612f, -0.03026325f, -0.54532051f, 0.33003211f, 0.44901288f, 0.21193194f}}, {8, {0.41613156f, 0.42610586f, -0.16495961f, -0.5663873f, 0.30579174f, -0.05115908f, -0.33941799f, 0.23364776f, 0.11178309f, 0.09481031f, -0.26424935f, 0.46261835f, 0.50248802f, 0.26114327f, -0.43736315f, 0.33149987f}}, {9, {}}, {10, {0.47485286f, -0.51955009f, -0.24458408f, 0.31544167f}}, {11, {-0.17135078f, 0.82760304f, 0.85573703f, -0.77109635f}}, {12, {}}, {13, {1.0f, 1.0f, 1.0f, 1.0f}}, {14, {0.0f, 0.0f, 0.0f, 0.0f}}, {15, {0.0f, 0.0f, 0.0f, 0.0f}}, {16, {}}, {17, {}}, {18, {-0.423122f, -0.0121822f, 0.24201f, -0.0812458f}}, {19, {-0.978419f, -0.139203f, 0.338163f, -0.0983904f}}, {21, {0.0f}}, {22, {0.0f}}},
+ // int -> INT32 map
+ {{20, {4}}},
+ // int -> QUANT8_ASYMM map
+ {}
+},
+//Output(s)
+{ // See tools/test_generator/include/TestHarness.h:MixedTyped
+ // int -> FLOAT32 map
+ {{1, {0, 0, 0, 0}}, {2, {0, 0, 0, 0}}, {3, {-0.358325f, -0.04621704f, 0.21641694f, -0.06471302f}}, {0, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}},
+ // int -> INT32 map
+ {},
+ // int -> QUANT8_ASYMM map
+ {}
+}
+}, // End of an example
diff --git a/nn/runtime/test/generated/examples/lstm3.example.cpp b/nn/runtime/test/generated/examples/lstm3.example.cpp
index 89d381479..c78dee690 100644
--- a/nn/runtime/test/generated/examples/lstm3.example.cpp
+++ b/nn/runtime/test/generated/examples/lstm3.example.cpp
@@ -13,7 +13,7 @@
//Output(s)
{ // See tools/test_generator/include/TestHarness.h:MixedTyped
// int -> FLOAT32 map
- {{1, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}, {2, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}, {3, {-0.00396806f, 0.029352f, -0.00279226f, 0.0159977f, -0.00835576f, -0.0211779f, 0.0283512f, -0.0114597f, 0.00907307f, -0.0244004f, -0.0152191f, -0.0259063f, 0.00914318f, 0.00415118f, 0.017147f, 0.0134203f, -0.013869f, 0.0287268f, -0.00334693f, 0.00733398f, -0.0287926f, -0.0186926f, 0.0193662f, -0.0115437f, 0.00422612f, -0.0345232f, 0.00223253f, -0.00957321f, 0.0210624f, 0.013331f, 0.0150954f, 0.02168f}}, {0, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}},
+ {{1, {-0.00396806f, 0.029352f, -0.00279226f, 0.0159977f, -0.00835577f, -0.0211779f, 0.0283512f, -0.0114597f, 0.00907307f, -0.0244004f, -0.0152191f, -0.0259063f, 0.00914318f, 0.00415119f, 0.017147f, 0.0134203f, -0.013869f, 0.0287268f, -0.00334694f, 0.00733397f, -0.0287926f, -0.0186926f, 0.0193662f, -0.0115437f, 0.00422612f, -0.0345232f, 0.00223253f, -0.00957321f, 0.0210624f, 0.013331f, 0.0150954f, 0.0216801f}}, {2, {-0.0531632f, -0.0118138f, 0.0870833f, 0.0347929f, -0.076144f, -0.0659219f, -0.0463811f, 0.0141307f, -0.0127706f, -0.03782f, -0.00402401f, -0.00571876f, -0.187957f, -0.0247127f, 0.0711425f, 0.008244f, 0.0492649f, 0.126972f, 0.0933097f, 0.29848f, -0.0966178f, -0.114417f, 0.0387229f, 0.0453255f, -0.181286f, -0.0651251f, -0.0996879f, -0.00276995f, 0.0617558f, -0.0100728f, 0.056304f, -0.077416f, -0.162858f, -0.0541251f, 0.0571202f, -0.0525331f, 0.0724297f, 0.171029f, 0.141738f, 0.295483f}}, {3, {-0.00396806f, 0.029352f, -0.00279226f, 0.0159977f, -0.00835576f, -0.0211779f, 0.0283512f, -0.0114597f, 0.00907307f, -0.0244004f, -0.0152191f, -0.0259063f, 0.00914318f, 0.00415118f, 0.017147f, 0.0134203f, -0.013869f, 0.0287268f, -0.00334693f, 0.00733398f, -0.0287926f, -0.0186926f, 0.0193662f, -0.0115437f, 0.00422612f, -0.0345232f, 0.00223253f, -0.00957321f, 0.0210624f, 0.013331f, 0.0150954f, 0.02168f}}, {0, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}},
// int -> INT32 map
{},
// int -> QUANT8_ASYMM map
diff --git a/nn/runtime/test/generated/examples/lstm3_state.example.cpp b/nn/runtime/test/generated/examples/lstm3_state.example.cpp
new file mode 100644
index 000000000..7f916759c
--- /dev/null
+++ b/nn/runtime/test/generated/examples/lstm3_state.example.cpp
@@ -0,0 +1,22 @@
+// Generated file (from: lstm3_state.mod.py). Do not edit
+// Begin of an example
+{
+//Input(s)
+{ // See tools/test_generator/include/TestHarness.h:MixedTyped
+ // int -> FLOAT32 map
+ {{0, {0.596268f, 0.998386f, 0.568695f, 0.864524f, 0.571277f, 0.642421f, 0.52426f, 0.134799f, 0.003639f, 0.162482f}}, {1, {0.021393683f, 0.06124551f, 0.046905167f, -0.014657677f, -0.03149463f, 0.09171803f, 0.14647801f, 0.10797193f, -0.0057968358f, 0.0019193048f, -0.2726754f, 0.10154029f, -0.018539885f, 0.080349885f, -0.10262385f, -0.022599787f, -0.09121155f, -0.008675967f, -0.045206103f, -0.0821282f, -0.008045952f, 0.015478081f, 0.055217247f, 0.038719587f, 0.044153627f, -0.06453243f, 0.05031825f, -0.046935108f, -0.008164439f, 0.014574226f, -0.1671009f, -0.15519552f, -0.16819797f, -0.13971269f, -0.11953059f, 0.25005487f, -0.22790983f, 0.009855087f, -0.028140958f, -0.11200698f, 0.11295408f, -0.0035217577f, 0.054485075f, 0.05184695f, 0.064711206f, 0.10989193f, 0.11674786f, 0.03490607f, 0.07727357f, 0.11390585f, -0.1863375f, -0.1034451f, -0.13945189f, -0.049401227f, -0.18767063f, 0.042483903f, 0.14233552f, 0.13832581f, 0.18350165f, 0.14545603f, -0.028545704f, 0.024939531f, 0.050929718f, 0.0076203286f, -0.0029723682f, -0.042484224f, -0.11827596f, -0.09171104f, -0.10808628f, -0.16327988f, -0.2273378f, -0.0993647f, -0.017155107f, 0.0023917493f, 0.049272764f, 0.0038534778f, 0.054764505f, 0.089753784f, 0.06947234f, 0.08014476f, -0.04544234f, -0.0497073f, -0.07135631f, -0.048929106f, -0.004042012f, -0.009284026f, 0.018042054f, 0.0036860977f, -0.07427302f, -0.11434604f, -0.018995456f, 0.031487543f, 0.012834908f, 0.019977754f, 0.044256654f, -0.39292613f, -0.18519334f, -0.11651281f, -0.06809892f, 0.011373677f}}, {2, {-0.0018401089f, -0.004852237f, 0.03698424f, 0.014181704f, 0.028273236f, -0.016726194f, -0.05249759f, -0.10204261f, 0.00861066f, -0.040979505f, -0.009899187f, 0.01923892f, -0.028177269f, -0.08535103f, -0.14585495f, 0.10662567f, -0.01909731f, -0.017883534f, -0.0047269356f, -0.045103323f, 0.0030784295f, 0.076784775f, 0.07463696f, 0.094531395f, 0.0814421f, -0.12257899f, -0.033945758f, -0.031303465f, 0.045630626f, 0.06843887f, -0.13492945f, -0.012480007f, -0.0811829f, -0.07224499f, -0.09628791f, 0.045100946f, 0.0012300825f, 0.013964662f, 0.099372394f, 0.02543059f, 0.06958324f, 0.034257296f, 0.0482646f, 0.06267997f, 0.052625068f, 0.12784666f, 0.07077897f, 0.025725935f, 0.04165009f, 0.07241905f, 0.018668644f, -0.037377294f, -0.06277783f, -0.08833636f, -0.040120605f, -0.011405586f, -0.007808335f, -0.010301386f, -0.005102167f, 0.027717464f, 0.05483423f, 0.11449111f, 0.11289652f, 0.10939839f, 0.13396506f, -0.08402166f, -0.01901462f, -0.044678304f, -0.07720565f, 0.014350063f, -0.11757958f, -0.0652038f, -0.08185733f, -0.076754324f, -0.092614375f, 0.10405491f, 0.052960336f, 0.035755895f, 0.035839386f, -0.012540553f, 0.036881298f, 0.02913376f, 0.03420159f, 0.05448447f, -0.054523353f, 0.02582715f, 0.02327355f, -0.011857179f, -0.0011980024f, -0.034641717f, -0.026125094f, -0.17582615f, -0.15923657f, -0.27486774f, -0.0006143371f, 0.0001771948f, -8.470171e-05f, 0.02651807f, 0.045790765f, 0.06956496f}}, {3, {-0.04580283f, -0.09549462f, -0.032418985f, -0.06454633f, -0.043528453f, 0.043018587f, -0.049152344f, -0.12418144f, -0.078985475f, -0.07596889f, 0.019484362f, -0.11434962f, -0.0074034138f, -0.06314844f, -0.092981495f, 0.0062155537f, -0.025034338f, -0.0028890965f, 0.048929527f, 0.06235075f, 0.10665918f, -0.032036792f, -0.08505916f, -0.10843358f, -0.13002433f, -0.036816437f, -0.02130134f, -0.016518239f, 0.0047691227f, -0.0025825808f, 0.066017866f, 0.029991534f, -0.10652836f, -0.1037554f, -0.13056071f, -0.03266643f, -0.033702414f, -0.006473424f, -0.04611692f, 0.014419339f, -0.025174323f, 0.0396852f, 0.081777506f, 0.06157468f, 0.10210095f, -0.009658194f, 0.046511717f, 0.03603906f, 0.0069369148f, 0.015960095f, -0.06507666f, 0.09551598f, 0.053568836f, 0.06408714f, 0.12835667f, -0.008714329f, -0.20211966f, -0.12093674f, 0.029450472f, 0.2849013f, -0.029227901f, 0.1164364f, -0.08560263f, 0.09941786f, -0.036999565f, -0.028842626f, -0.0033637602f, -0.017012902f, -0.09720865f, -0.11193351f, -0.029155117f, -0.017936034f, -0.009768936f, -0.04223324f, -0.036159635f, 0.06505112f, -0.021742892f, -0.023377212f, -0.07221364f, -0.06430552f, 0.05453865f, 0.091149814f, 0.06387331f, 0.007518393f, 0.055960953f, 0.069779344f, 0.046411168f, 0.10509911f, 0.07463894f, 0.0075130584f, 0.012850982f, 0.04555431f, 0.056955688f, 0.06555285f, 0.050801456f, -0.009862683f, 0.00826772f, -0.026555609f, -0.0073611983f, -0.0014897042f}}, {4, {-0.0998932f, -0.07201956f, -0.052803773f, -0.15629593f, -0.15001918f, -0.07650751f, 0.02359855f, -0.075155355f, -0.08037709f, -0.15093534f, 0.029517552f, -0.04751393f, 0.010350531f, -0.02664851f, -0.016839722f, -0.023121163f, 0.0077019283f, 0.012851257f, -0.05040649f, -0.0129761f, -0.021737747f, -0.038305793f, -0.06870586f, -0.01481247f, -0.001285394f, 0.10124236f, 0.083122835f, 0.053313006f, -0.062235646f, -0.075637154f, -0.027833903f, 0.029774971f, 0.1130802f, 0.09218906f, 0.09506135f, -0.086665764f, -0.037162706f, -0.038880914f, -0.035832845f, -0.014481564f, -0.09825003f, -0.12048569f, -0.097665586f, -0.05287633f, -0.0964047f, -0.11366429f, 0.035777505f, 0.13568819f, 0.052451383f, 0.050649304f, 0.05798951f, -0.021852335f, -0.099848844f, 0.014740475f, -0.078897946f, 0.04974699f, 0.014160473f, 0.06973932f, 0.04964942f, 0.033364646f, 0.08190124f, 0.025535367f, 0.050893165f, 0.048514254f, 0.06945813f, -0.078907564f, -0.06707616f, -0.11844508f, -0.09986688f, -0.07509403f, 0.06263226f, 0.14925587f, 0.20188436f, 0.12098451f, 0.14639415f, 0.0015017595f, -0.014267382f, -0.03417257f, 0.012711468f, 0.0028300495f, -0.024758482f, -0.05098548f, -0.0821182f, 0.014225672f, 0.021544158f, 0.08949725f, 0.07505268f, -0.0020780868f, 0.04908258f, 0.06476295f, -0.022907063f, 0.027562456f, 0.040185735f, 0.019567577f, -0.015598739f, -0.049097303f, -0.017121866f, -0.083368234f, -0.02332002f, -0.0840956f}}, {5, {-0.001374326f, -0.078856036f, 0.10672688f, 0.029162422f, -0.11585556f, 0.02557986f, -0.13446963f, -0.035785314f, -0.01244275f, 0.025961924f, -0.02337298f, -0.044228926f, -0.055839065f, -0.046598054f, -0.010546039f, -0.06900766f, 0.027239809f, 0.022582639f, -0.013296484f, -0.05459212f, 0.08981f, -0.045407712f, 0.08682226f, -0.06867011f, -0.14390695f, -0.02916037f, 0.000996957f, 0.091420636f, 0.14283475f, -0.07390571f, -0.06402044f, 0.062524505f, -0.093129106f, 0.04860203f, -0.08364217f, -0.08119002f, 0.009352075f, 0.22920375f, 0.0016303885f, 0.11583097f, -0.13732095f, 0.012405723f, -0.07551853f, 0.06343048f, 0.12162708f, -0.031923793f, -0.014335606f, 0.01790974f, -0.10650317f, -0.0724401f, 0.08554849f, -0.05727212f, 0.06556731f, -0.042729504f, -0.043227166f, 0.011683251f, -0.013082158f, -0.029302018f, -0.010899579f, -0.062036745f, -0.022509435f, -0.00964907f, -0.01567329f, 0.04260106f, -0.07787477f, -0.11576462f, 0.017356863f, 0.048673786f, -0.017577527f, -0.05527947f, -0.082487635f, -0.040137455f, -0.10820036f, -0.04666372f, 0.022746278f, -0.07851417f, 0.01068115f, 0.032956902f, 0.022433773f, 0.0026891115f, 0.08944216f, -0.0685835f, 0.010513544f, 0.07228705f, 0.02032331f, -0.059686817f, -0.0005566496f, -0.086984694f, 0.040414046f, -0.1380399f, 0.094208956f, -0.05722982f, 0.012092817f, -0.04989123f, -0.086576f, -0.003399834f, -0.04696032f, -0.045747425f, 0.10091314f, 0.048676282f, -0.029037097f, 0.031399418f, -0.0040285117f, 0.047237843f, 0.09504992f, 0.041799378f, -0.049185462f, -0.031518843f, -0.10516937f, 0.026374253f, 0.10058866f, -0.0033195973f, -0.041975245f, 0.0073591834f, 0.0033782164f, -0.004325073f, -0.10167381f, 0.042500053f, -0.01447153f, 0.06464186f, -0.017142897f, 0.03312627f, 0.009205989f, 0.024138335f, -0.011337001f, 0.035530265f, -0.010912711f, 0.0706555f, -0.005894094f, 0.051841937f, -0.1401738f, -0.02351249f, 0.0365468f, 0.07590991f, 0.08838724f, 0.021681072f, -0.10086113f, 0.019608743f, -0.06195883f, 0.077335775f, 0.023646897f, -0.095322326f, 0.02233014f, 0.09756986f, -0.048691444f, -0.009579111f, 0.07595467f, 0.11480546f, -0.09801813f, 0.019894179f, 0.08502348f, 0.004032281f, 0.037211012f, 0.068537936f, -0.048005626f, -0.091520436f, -0.028379958f, -0.01556313f, 0.06554592f, -0.045599163f, -0.01672207f, -0.020169014f, -0.011877351f, -0.20212261f, 0.010889619f, 0.0047078193f, 0.038385306f, 0.08540671f, -0.017140968f, -0.0035865551f, 0.016678626f, 0.005633034f, 0.015963363f, 0.00871737f, 0.060130805f, 0.028611384f, 0.10109069f, -0.015060172f, -0.07894427f, 0.06401885f, 0.011584063f, -0.024466386f, 0.0047652307f, -0.09041358f, 0.030737216f, -0.0046374933f, 0.14215417f, -0.11823516f, 0.019899689f, 0.006106124f, -0.027092824f, 0.0786356f, 0.05052217f, -0.058925f, -0.011402121f, -0.024987547f, -0.0013661642f, -0.06832946f, -0.015667673f, -0.1083353f, -0.00096863037f, -0.06988685f, -0.053350925f, -0.027275559f, -0.033664223f, -0.07978348f, -0.025200296f, -0.017207067f, -0.058403496f, -0.055697463f, 0.005798788f, 0.12965427f, -0.062582195f, 0.0013350133f, -0.10482091f, 0.0379771f, 0.072521195f, -0.0029455067f, -0.13797039f, -0.03628521f, 0.013806405f, -0.017858358f, -0.01008298f, -0.07700066f, -0.017081132f, 0.019358726f, 0.0027079724f, 0.004635139f, 0.062634714f, -0.02338735f, -0.039547626f, -0.02050681f, 0.03385117f, -0.083611414f, 0.002862572f, -0.09421313f, 0.058618143f, -0.08598433f, 0.00972939f, 0.023867095f, -0.053934585f, -0.023203006f, 0.07452513f, -0.048767887f, -0.07314807f, -0.056307215f, -0.10433547f, -0.06440842f, 0.04328182f, 0.04389765f, -0.020006588f, -0.09076438f, -0.11652589f, -0.021705797f, 0.03345259f, -0.010329105f, -0.025767034f, 0.013057034f, -0.07316461f, -0.10145612f, 0.06358255f, 0.18531723f, 0.07759293f, 0.12006465f, 0.1305557f, 0.058638252f, -0.03393652f, 0.09622831f, -0.16253184f, -2.4580743e-06f, 0.079869635f, -0.070196845f, -0.005644518f, 0.06857898f, -0.12598175f, -0.035084512f, 0.03156317f, -0.12794146f, -0.031963028f, 0.04692781f, 0.030070418f, 0.0071660685f, -0.095516115f, -0.004643372f, 0.040170413f, -0.062104587f, -0.0037324072f, 0.0554317f, 0.08184801f, -0.019164372f, 0.06791302f, 0.034257166f, -0.10307039f, 0.021943003f, 0.046745934f, 0.0790918f, -0.0265588f, -0.007824208f, 0.042546265f, -0.00977924f, -0.0002440307f, -0.017384544f, -0.017990116f, 0.12252321f, -0.014512694f, -0.08251313f, 0.08861942f, 0.13589665f, 0.026351685f, 0.012641483f, 0.07466548f, 0.044301085f, -0.045414884f, -0.051112458f, 0.03444247f, -0.08502782f, -0.04106223f, -0.028126027f, 0.028473156f, 0.10467447f}}, {6, {-0.057784554f, -0.026057621f, -0.068447545f, -0.022581743f, 0.14811787f, 0.10826372f, 0.09471067f, 0.03987225f, -0.0039523416f, 0.00030638507f, 0.053185795f, 0.10572994f, 0.08414449f, -0.022036452f, -0.00066928595f, -0.09203576f, 0.032950465f, -0.10985798f, -0.023809856f, 0.0021431844f, -0.02196096f, -0.00326074f, 0.00058621005f, -0.074678116f, -0.06193199f, 0.055729095f, 0.03736828f, 0.020123724f, 0.061878487f, -0.04729229f, 0.034919553f, -0.07585433f, -0.04421272f, -0.044019096f, 0.085488975f, 0.04058006f, -0.06890133f, -0.030951202f, -0.024628663f, -0.07672815f, 0.034293607f, 0.08556707f, -0.05293577f, -0.033561368f, -0.04899627f, 0.0241671f, 0.015736353f, -0.095442444f, -0.029564252f, 0.016493602f, -0.035026584f, 0.022337519f, -0.026871363f, 0.004780428f, 0.0077918363f, -0.03601621f, 0.016435321f, -0.03263031f, -0.09543275f, -0.047392778f, 0.013454138f, 0.028934088f, 0.01685226f, -0.086110644f, -0.046250615f, -0.01847454f, 0.047608484f, 0.07339695f, 0.034546845f, -0.04881143f, 0.009128804f, -0.08802852f, 0.03761666f, 0.008096139f, -0.014454086f, 0.014361001f, -0.023502491f, -0.0011840804f, -0.07607001f, 0.001856849f, -0.06509276f, -0.006021153f, -0.08570962f, -0.1451793f, 0.060212336f, 0.055259194f, 0.06974018f, 0.049454916f, -0.027794661f, -0.08077226f, -0.016179763f, 0.1169753f, 0.17213494f, -0.0056326236f, -0.053934924f, -0.0124349f, -0.11520337f, 0.05409887f, 0.088759385f, 0.0019655675f, 0.0042065294f, 0.03881498f, 0.019844765f, 0.041858196f, -0.05695512f, 0.047233116f, 0.038937137f, -0.06542224f, 0.014429736f, -0.09719407f, 0.13908425f, -0.05379757f, 0.012321099f, 0.082840554f, -0.029899208f, 0.044217527f, 0.059855383f, 0.07711018f, -0.045319796f, 0.0948846f, -0.011724666f, -0.0033288454f, -0.033542685f, -0.04764985f, -0.13873616f, 0.040668588f, 0.034832682f, -0.015319203f, -0.018715994f, 0.046002675f, 0.0599172f, -0.043107376f, 0.0294216f, -0.002314414f, -0.022424703f, 0.0030315618f, 0.0014641669f, 0.0029166266f, -0.11878115f, 0.013738511f, 0.12375372f, -0.0006038222f, 0.029104086f, 0.087442465f, 0.052958444f, 0.07558703f, 0.04817258f, 0.044462286f, -0.015213451f, -0.08783778f, -0.0561384f, -0.003008196f, 0.047060397f, -0.002058388f, 0.03429439f, -0.018839769f, 0.024734668f, 0.024614193f, -0.042046934f, 0.09597743f, -0.0043254104f, 0.04320769f, 0.0064070094f, -0.0019131786f, -0.02558259f, -0.022822596f, -0.023273505f, -0.02464396f, -0.10991725f, -0.006240552f, 0.0074488563f, 0.024044557f, 0.04383914f, -0.046476185f, 0.028658995f, 0.060410924f, 0.050786525f, 0.009452605f, -0.0073054377f, -0.024810238f, 0.0052906186f, 0.0066939713f, -0.0020913032f, 0.014515517f, 0.015898481f, 0.021362653f, -0.030262267f, 0.016587038f, -0.011442813f, 0.041154444f, -0.007631438f, -0.03423484f, -0.010977775f, 0.036152758f, 0.0066366293f, 0.11915515f, 0.02318443f, -0.041350313f, 0.021485701f, -0.10906167f, -0.028218046f, -0.00954771f, 0.020531068f, -0.11995105f, -0.03672871f, 0.024019798f, 0.014255957f, -0.05221243f, -0.00661567f, -0.04630967f, 0.033188973f, 0.10107534f, -0.014027541f, 0.030796422f, -0.10270911f, -0.035999842f, 0.15443139f, 0.07684145f, 0.036571592f, -0.035900835f, -0.0034699554f, 0.06209149f, 0.015920248f, -0.031122351f, -0.03858649f, 0.01849943f, 0.13872518f, 0.01503974f, 0.069941424f, -0.06948533f, -0.0088794185f, 0.061282158f, -0.047401894f, 0.03100163f, -0.041533746f, -0.10430945f, 0.044574402f, -0.01425562f, -0.024290353f, 0.034563623f, 0.05866852f, 0.023947537f, -0.09445152f, 0.035450947f, 0.02247216f, -0.0042998926f, 0.061146557f, -0.10250651f, 0.020881841f, -0.06747029f, 0.10062043f, -0.0023941975f, 0.03532124f, -0.016341697f, 0.09685456f, -0.016764693f, 0.051808182f, 0.05875331f, -0.04536488f, 0.001626336f, -0.028892258f, -0.01048663f, -0.009793449f, -0.017093895f, 0.010987891f, 0.02357273f, -0.00010856845f, 0.0099760275f, -0.001845119f, -0.03551521f, 0.0018358806f, 0.05763657f, -0.01769146f, 0.040995963f, 0.02235177f, -0.060430344f, 0.11475477f, -0.023854522f, 0.10071741f, 0.0686208f, -0.014250481f, 0.034261297f, 0.047418304f, 0.08562733f, -0.030519066f, 0.0060542435f, 0.014653856f, -0.038836084f, 0.04096551f, 0.032249358f, -0.08355519f, -0.026823482f, 0.056386515f, -0.010401743f, -0.028396193f, 0.08507674f, 0.014410365f, 0.020995233f, 0.17040324f, 0.11511526f, 0.02459721f, 0.0066619175f, 0.025853224f, -0.023133837f, -0.081302024f, 0.017264642f, -0.009585969f, 0.09491168f, -0.051313367f, 0.054532815f, -0.014298593f, 0.10657464f, 0.007076659f, 0.10964551f, 0.0409152f, 0.008275321f, -0.07283536f, 0.07937492f, 0.04192024f, -0.1075027f}}, {7, {-0.037322544f, 0.018592842f, 0.0056175636f, -0.06253426f, 0.055647098f, -0.05713207f, -0.05626563f, 0.005559383f, 0.03375411f, -0.025757805f, -0.088049285f, 0.06017052f, -0.06570978f, 0.007384076f, 0.035123326f, -0.07920549f, 0.053676967f, 0.044480428f, -0.07663568f, 0.0071805613f, 0.08089997f, 0.05143358f, 0.038261272f, 0.03339287f, -0.027673481f, 0.044746667f, 0.028349208f, 0.020090483f, -0.019443132f, -0.030755889f, -0.0040000007f, 0.04465846f, -0.021585021f, 0.0031670958f, 0.0053199246f, -0.056117613f, -0.10893326f, 0.076739706f, -0.08509834f, -0.027997585f, 0.037871376f, 0.01449768f, -0.09002357f, -0.06111149f, -0.046195522f, 0.0422062f, -0.005683705f, -0.1253618f, -0.012925729f, -0.04890792f, 0.06985068f, 0.037654128f, 0.03398274f, -0.004781977f, 0.007032333f, -0.031787455f, 0.010868644f, -0.031489216f, 0.09525667f, 0.013939797f, 0.0058680447f, 0.0167067f, 0.02668468f, -0.04797466f, -0.048885044f, -0.12722108f, 0.035304096f, 0.06554885f, 0.00972396f, -0.039238118f, -0.05159735f, -0.11329045f, 0.1613692f, -0.03750952f, 0.06529313f, -0.071974665f, -0.11769596f, 0.015524369f, -0.0013754242f, -0.12446318f, 0.02786344f, -0.014179351f, 0.005264273f, 0.14376344f, 0.015983658f, 0.03406988f, -0.06939408f, 0.040699873f, 0.02111075f, 0.09669095f, 0.041345075f, -0.08316494f, -0.07684199f, -0.045768797f, 0.032298047f, -0.041805092f, 0.0119405f, 0.0061010392f, 0.12652606f, 0.0064572375f, -0.024950314f, 0.11574242f, 0.04508852f, -0.04335324f, 0.06760663f, -0.027437469f, 0.07216407f, 0.06977076f, -0.05438599f, 0.034033038f, -0.028602652f, 0.05346137f, 0.043184172f, -0.037189785f, 0.10420091f, 0.00882477f, -0.054019816f, -0.074273005f, -0.030617684f, -0.0028467078f, 0.024302477f, -0.0038869337f, 0.005332455f, 0.0013399826f, 0.04361412f, -0.007001822f, 0.09631092f, -0.06702025f, -0.042049985f, -0.035070654f, -0.04103342f, -0.10273396f, 0.0544271f, 0.037184782f, -0.13150354f, -0.0058036847f, -0.008264958f, 0.042035464f, 0.05891794f, 0.029673764f, 0.0063542654f, 0.044788733f, 0.054816857f, 0.062257513f, -0.00093483756f, 0.048938446f, -0.004952862f, -0.007730018f, -0.04043371f, -0.017094059f, 0.07229206f, -0.023670016f, -0.052195564f, -0.025616996f, -0.01520939f, 0.045104615f, -0.007376126f, 0.003533447f, 0.006570588f, 0.056037236f, 0.12436656f, 0.051817212f, 0.028532185f, -0.08686856f, 0.11868599f, 0.07663395f, -0.07323171f, 0.03463402f, -0.050708205f, -0.04458982f, -0.11590894f, 0.021273347f, 0.1251325f, -0.15313013f, -0.12224372f, 0.17228661f, 0.023029093f, 0.086124025f, 0.006445803f, -0.03496501f, 0.028332196f, 0.04449512f, -0.042436164f, -0.026587414f, -0.006041347f, -0.09292539f, -0.05678812f, 0.03897832f, 0.09465633f, 0.008115513f, -0.02171956f, 0.08304309f, 0.071401566f, 0.019622514f, 0.032163795f, -0.004167056f, 0.02295182f, 0.030739572f, 0.056506045f, 0.004612461f, 0.06524936f, 0.059999723f, 0.046395954f, -0.0045512207f, -0.1335546f, -0.030136576f, 0.11584653f, -0.014678886f, 0.0020118146f, -0.09688814f, -0.0790206f, 0.039770417f, -0.0329582f, 0.07922767f, 0.029322514f, 0.026405897f, 0.04207835f, -0.07073373f, 0.063781224f, 0.0859677f, -0.10925287f, -0.07011058f, 0.048005477f, 0.03438226f, -0.09606514f, -0.006669445f, -0.043381985f, 0.04240257f, -0.06955775f, -0.06769346f, 0.043903265f, -0.026784198f, -0.017840602f, 0.024307009f, -0.040079936f, -0.019946516f, 0.045318738f, -0.12233574f, 0.026170589f, 0.0074471775f, 0.15978073f, 0.10185836f, 0.10298046f, -0.015476589f, -0.039390966f, -0.072174534f, 0.0739445f, -0.1211869f, -0.0347889f, -0.07943156f, 0.014809798f, -0.12412325f, -0.0030663363f, 0.039695457f, 0.0647603f, -0.08291318f, -0.018529687f, -0.004423833f, 0.0037507233f, 0.084633216f, -0.01514876f, -0.056505352f, -0.012800942f, -0.06994386f, 0.012962922f, -0.031234352f, 0.07029052f, 0.016418684f, 0.03618972f, 0.055686004f, -0.08663945f, -0.017404709f, -0.054761406f, 0.029065743f, 0.052404847f, 0.020238016f, 0.0048197987f, -0.0214882f, 0.07078733f, 0.013016777f, 0.06262858f, 0.009184685f, 0.020785125f, -0.043904778f, -0.0270329f, -0.03299152f, -0.060088247f, -0.015162964f, -0.001828936f, 0.12642565f, -0.056757294f, 0.013586685f, 0.09232601f, -0.035886683f, 0.06000002f, 0.05229691f, -0.052580316f, -0.082029596f, -0.010794592f, 0.012947712f, -0.036429964f, -0.085508935f, -0.13127148f, -0.017744139f, 0.031502828f, 0.036232427f, -0.031581745f, 0.023051167f, -0.05325106f, -0.03421577f, 0.028793324f, -0.034633752f, -0.009881397f, -0.043551125f, -0.018609839f, 0.0019097115f, -0.008799762f, 0.056595087f, 0.0022273948f, 0.055752404f}}, {8, {0.025825322f, -0.05813119f, 0.09495884f, -0.045984812f, -0.01255415f, -0.0026479573f, -0.08196161f, -0.054914974f, -0.0046604523f, -0.029587349f, -0.044576716f, -0.07480124f, -0.082868785f, 0.023254942f, 0.027502948f, -0.0039728214f, -0.08683098f, -0.08116779f, -0.014675607f, -0.037924774f, -0.023314456f, -0.007401714f, -0.09255757f, 0.029460307f, -0.08829125f, -0.005139627f, -0.08989442f, -0.0555066f, 0.13596267f, -0.025062224f, -0.048351806f, -0.03850004f, 0.07266485f, -0.022414139f, 0.05940088f, 0.075114764f, 0.09597592f, -0.010211725f, -0.0049794707f, -0.011523867f, -0.025980417f, 0.072999895f, 0.11091378f, -0.081685916f, 0.014416728f, 0.043229222f, 0.034178585f, -0.07530371f, 0.035837382f, -0.085607f, -0.007721233f, -0.03287832f, -0.043848954f, -0.06404588f, -0.06632928f, -0.073643476f, 0.008214239f, -0.045984086f, 0.039764922f, 0.03474462f, 0.060612556f, -0.080590084f, 0.049127717f, 0.04151091f, -0.030063879f, 0.008801774f, -0.023021035f, -0.019558564f, 0.05158114f, -0.010947698f, -0.011825728f, 0.0075720972f, 0.0699727f, -0.0039981045f, 0.069350146f, 0.08799282f, 0.016156472f, 0.035502106f, 0.11695009f, 0.006217345f, 0.13392477f, -0.037875112f, 0.025745004f, 0.08940699f, -0.00924166f, 0.0046702605f, -0.036598757f, -0.08811812f, 0.10522024f, -0.032441203f, 0.008176899f, -0.04454919f, 0.07058152f, 0.0067963637f, 0.039206743f, 0.03259838f, 0.03725492f, -0.09515802f, 0.013326398f, -0.052055415f, -0.025676316f, 0.03198509f, -0.015951829f, -0.058556724f, 0.036879618f, 0.043357447f, 0.028362012f, -0.05908629f, 0.0059240665f, -0.04995891f, -0.019187413f, 0.0276265f, -0.01628143f, 0.0025863599f, 0.08800015f, 0.035250366f, -0.022165963f, -0.07328642f, -0.009415526f, -0.07455109f, 0.11690406f, 0.0363299f, 0.07411125f, 0.042103454f, -0.009660886f, 0.019076364f, 0.018299393f, -0.046004917f, 0.08891175f, 0.0431396f, -0.026327137f, -0.051502608f, 0.08979574f, -0.051670972f, 0.04940282f, -0.07491107f, -0.021240504f, 0.022596184f, -0.034280192f, 0.060163025f, -0.058211457f, -0.051837247f, -0.01349775f, -0.04639988f, -0.035936575f, -0.011681591f, 0.064818054f, 0.0073146066f, -0.021745546f, -0.043124277f, -0.06471268f, -0.07053354f, -0.029321948f, -0.05330136f, 0.016933719f, -0.053782392f, 0.13747959f, -0.1361751f, -0.11569455f, 0.0033329215f, 0.05693899f, -0.053219706f, 0.063698f, 0.07977434f, -0.07924483f, 0.06936997f, 0.0034815092f, -0.007305279f, -0.037325785f, -0.07251102f, -0.033633437f, -0.08677009f, 0.091591336f, -0.14165086f, 0.021752775f, 0.019683983f, 0.0011612234f, -0.058154266f, 0.049996935f, 0.0288841f, -0.0024567875f, -0.14345716f, 0.010955264f, -0.10234828f, 0.1183656f, -0.0010731248f, -0.023590032f, -0.072285876f, -0.0724771f, -0.026382286f, -0.0014920527f, 0.042667855f, 0.0018776858f, 0.02986552f, 0.009814309f, 0.0733756f, 0.12289186f, 0.018043943f, -0.0458958f, 0.049412545f, 0.033632483f, 0.05495232f, 0.036686596f, -0.013781798f, -0.010036754f, 0.02576849f, -0.08307328f, 0.010112348f, 0.042521734f, -0.05869831f, -0.071689695f, 0.03876447f, -0.13275425f, -0.0352966f, -0.023077697f, 0.10285965f, 0.084736146f, 0.15568255f, -0.00040734606f, 0.027835453f, -0.10292561f, -0.032401145f, 0.10053256f, -0.026142767f, -0.08271222f, -0.0030240538f, -0.016368777f, 0.1070414f, 0.042672627f, 0.013456989f, -0.0437609f, -0.022309763f, 0.11576483f, 0.04108048f, 0.061026827f, -0.0190714f, -0.0869359f, 0.037901703f, 0.0610107f, 0.07202949f, 0.01675338f, 0.086139716f, -0.08795751f, -0.014898893f, -0.023771819f, -0.01965048f, 0.007955471f, -0.043740474f, 0.03346837f, -0.10549954f, 0.090567775f, 0.042013682f, -0.03176985f, 0.12569028f, -0.02421228f, -0.029526481f, 0.023851605f, 0.031539805f, 0.05292009f, -0.02344001f, -0.07811758f, -0.08834428f, 0.10094801f, 0.16594367f, -0.06861939f, -0.021256343f, -0.041093912f, -0.06669611f, 0.035498552f, 0.021757556f, -0.09302526f, -0.015403468f, -0.06614931f, -0.051798206f, -0.013874718f, 0.03630673f, 0.010412845f, -0.08077351f, 0.046185967f, 0.0035662893f, 0.03541868f, -0.094149634f, -0.034814864f, 0.003128424f, -0.020674974f, -0.03944324f, -0.008110165f, -0.11113267f, 0.08484226f, 0.043586485f, 0.040582247f, 0.0968012f, -0.065249965f, -0.028036479f, 0.0050708856f, 0.0017462453f, 0.0326779f, 0.041296225f, 0.09164146f, -0.047743853f, -0.015952192f, -0.034451712f, 0.084197424f, -0.05347844f, -0.11768019f, 0.085926116f, -0.08251791f, -0.045081906f, 0.0948852f, 0.068401024f, 0.024856757f, 0.06978981f, -0.057309967f, -0.012775832f, -0.0032452994f, 0.01977615f, -0.041040014f, -0.024264973f, 0.063464895f, 0.05431621f}}, {9, {0.040369894f, 0.030746894f, 0.24704495f, 0.018586371f, -0.037586458f, -0.15312155f, -0.11812848f, -0.11465643f, 0.20259799f, 0.11418174f, -0.10116027f, -0.011334949f, 0.12411352f, -0.076769054f, -0.052169047f, 0.21198851f, -0.38871562f, -0.09061183f, -0.09683246f, -0.21929175f}}, {10, {-0.01998659f, -0.15568835f, -0.24248174f, -0.012770197f, 0.041331276f, -0.072311886f, -0.052123554f, -0.0066330447f, -0.043891653f, 0.036225766f, -0.047248036f, 0.021479502f, 0.033189066f, 0.11952997f, -0.020432774f, 0.64658105f, -0.06650122f, -0.03467612f, 0.095340036f, 0.23647355f}}, {11, {0.08286371f, -0.08261836f, -0.51210177f, 0.002913762f, 0.17764764f, -0.5495371f, -0.08460716f, -0.24552552f, 0.030037103f, 0.04123544f, -0.11940523f, 0.007358328f, 0.1890978f, 0.4833202f, -0.34441817f, 0.36312827f, -0.26375428f, 0.1457655f, -0.19724406f, 0.15548733f}}, {12, {0.02234832f, 0.14757581f, 0.18176508f, 0.10380666f, 0.053110216f, -0.06928846f, -0.13942584f, -0.11816189f, 0.19483899f, 0.03652339f, -0.10250295f, 0.036714908f, -0.18426876f, 0.036065217f, 0.21810818f, 0.02383196f, -0.043370757f, 0.08690144f, -0.04444982f, 0.00030581196f}}, {13, {0.035185695f, -0.042891346f, -0.03032477f, 0.23027696f, 0.11098921f, 0.15378423f, 0.09263801f, 0.09790885f, 0.09508917f, 0.061199076f, 0.07665568f, -0.015443159f, -0.03499149f, 0.046190713f, 0.08895977f, 0.10899629f, 0.40694186f, 0.06030037f, 0.012413437f, -0.06108739f}}, {14, {-0.024379363f, 0.0055531194f, 0.23377132f, 0.033463873f, -0.1483596f, -0.10639995f, -0.091433935f, 0.058573797f, -0.06809782f, -0.07889636f, -0.043246906f, -0.09829136f, -0.4279842f, 0.034901652f, 0.18797937f, 0.0075234566f, 0.016178843f, 0.1749513f, 0.13975595f, 0.92058027f}}, {15, {0.046159424f, -0.0012809046f, 0.03563469f, 0.12648113f, 0.027195795f, 0.35373217f, -0.018957434f, 0.008907322f, -0.0762701f, 0.12018895f, 0.04216877f, 0.0022856654f, 0.040952638f, 0.3147856f, 0.08225149f, -0.057416286f, -0.14995944f, -0.008040261f, 0.13208859f, 0.029760877f}}, {16, {-0.009802181f, 0.09401916f, 0.0717386f, -0.13895074f, 0.09641832f, 0.060420845f, 0.08539281f, 0.054285463f, 0.061395317f, 0.034448683f, -0.042991187f, 0.019801661f, -0.16840284f, -0.015726732f, -0.23041931f, -0.024478018f, -0.10959692f, -0.013875541f, 0.18600968f, -0.061274476f, 0.0138165f, -0.08160894f, -0.07661644f, 0.032372914f, 0.16169067f, 0.22465782f, -0.03993472f, -0.004017731f, 0.08633481f, -0.28869787f, 0.08682067f, 0.17240396f, 0.014975425f, 0.056431185f, 0.031037588f, 0.16702051f, 0.0077946745f, 0.15140012f, 0.29405436f, 0.120285f, -0.188994f, -0.027265169f, 0.043389652f, -0.022061434f, 0.014777949f, -0.20203483f, 0.094781205f, 0.19100232f, 0.13987629f, -0.036132768f, -0.06426278f, -0.05108664f, 0.13221376f, 0.009441198f, -0.16715929f, 0.15859416f, -0.040437475f, 0.050779544f, -0.022187516f, 0.012166504f, 0.027685808f, -0.07675938f, -0.0055694645f, -0.09444123f, 0.0046453946f, 0.050794356f, 0.10770313f, -0.20790008f, -0.07149004f, -0.11425117f, 0.008225835f, -0.035802525f, 0.14374903f, 0.15262283f, 0.048710253f, 0.1847461f, -0.007487823f, 0.11000021f, -0.09542012f, 0.22619456f, -0.029149994f, 0.08527916f, 0.009043713f, 0.0042746216f, 0.016261552f, 0.022461696f, 0.12689082f, -0.043589946f, -0.12035478f, -0.08361797f, -0.050666027f, -0.1248618f, -0.1275799f, -0.071875185f, 0.07377272f, 0.09944291f, -0.18897448f, -0.1593054f, -0.06526116f, -0.040107165f, -0.004618631f, -0.067624845f, -0.007576253f, 0.10727444f, 0.041546922f, -0.20424393f, 0.06907816f, 0.050412357f, 0.00724631f, 0.039827548f, 0.12449835f, 0.10747581f, 0.13708383f, 0.09134148f, -0.12617786f, -0.06428341f, 0.09956831f, 0.1208086f, -0.14676677f, -0.0727722f, 0.1126304f, 0.010139365f, 0.015571211f, -0.038128063f, 0.022913318f, -0.042050496f, 0.16842307f, -0.060597885f, 0.10531834f, -0.06411776f, -0.07451711f, -0.03410368f, -0.13393489f, 0.06534304f, 0.003620307f, 0.04490757f, 0.05970546f, 0.05197996f, 0.02839995f, 0.10434969f, -0.013699693f, -0.028353551f, -0.07260381f, 0.047201227f, -0.024575593f, -0.036445823f, 0.07155557f, 0.009672501f, -0.02328883f, 0.009533515f, -0.03606021f, -0.07421458f, -0.028082801f, -0.2678904f, -0.13221288f, 0.18419984f, -0.13012612f, -0.014588381f, -0.035059117f, -0.04824723f, 0.07830115f, -0.056184657f, 0.03277091f, 0.025466874f, 0.14494097f, -0.12522776f, -0.098633975f, -0.10766018f, -0.08317623f, 0.08594209f, 0.07749552f, 0.039474737f, 0.1776665f, -0.07409566f, -0.0477268f, 0.29323658f, 0.10801441f, 0.1154011f, 0.013952499f, 0.10739139f, 0.10708251f, -0.051456142f, 0.0074137426f, -0.10430189f, 0.10034707f, 0.045594677f, 0.0635285f, -0.0715442f, -0.089667566f, -0.10811871f, 0.00026344223f, 0.08298446f, -0.009525053f, 0.006585689f, -0.24567553f, -0.09450807f, 0.09648481f, 0.026996298f, -0.06419476f, -0.04752702f, -0.11063944f, -0.23441927f, -0.17608605f, -0.052156363f, 0.067035615f, 0.19271925f, -0.0032889997f, -0.043264326f, 0.09663576f, -0.057112187f, -0.10100678f, 0.0628376f, 0.04447668f, 0.017961001f, -0.10094388f, -0.10190601f, 0.18335468f, 0.10494553f, -0.052095775f, -0.0026118709f, 0.10539724f, -0.04383912f, -0.042349473f, 0.08438151f, -0.1947263f, 0.02251204f, 0.11216432f, -0.10307853f, 0.17351969f, -0.039091777f, 0.08066188f, -0.00561982f, 0.12633002f, 0.11335965f, -0.0088127935f, -0.019777594f, 0.06864014f, -0.059751723f, 0.016233567f, -0.06894641f, -0.28651384f, -0.004228674f, 0.019708522f, -0.16305895f, -0.07468996f, -0.0855457f, 0.099339016f, -0.07580735f, -0.13775392f, 0.08434318f, 0.08330512f, -0.12131499f, 0.031935584f, 0.09180414f, -0.08876437f, -0.08049874f, 0.008753825f, 0.03498998f, 0.030215185f, 0.03907079f, 0.089751154f, 0.029194152f, -0.03337423f, -0.019092513f, 0.04331237f, 0.04299654f, -0.036394123f, -0.12915532f, 0.09793732f, 0.07512415f, -0.11319543f, -0.032502122f, 0.15661901f, 0.07671967f, -0.005491124f, -0.19379048f, -0.218606f, 0.21448623f, 0.017840758f, 0.1416943f, -0.07051762f, 0.19488361f, 0.02664691f, -0.18104725f, -0.09334311f, 0.15026465f, -0.15493552f, -0.057762887f, -0.11604192f, -0.262013f, -0.01391798f, 0.012185008f, 0.11156489f, -0.07483202f, 0.06693364f, -0.26151478f, 0.046425626f, 0.036540434f, -0.16435726f, 0.17338543f, -0.21401681f, -0.11385144f, -0.08283257f, -0.069031075f, 0.030635102f, 0.010969227f, 0.11109743f, 0.010919218f, 0.027526086f, 0.13519906f, 0.01891392f, -0.046839405f, -0.040167913f, 0.017953383f, -0.09700955f, 0.0061885654f, -0.07000971f, 0.026893595f, -0.038844477f, 0.14543656f}}, {17, {}}, {18, {-0.00396806f, 0.029352f, -0.00279226f, 0.0159977f, -0.00835577f, -0.0211779f, 0.0283512f, -0.0114597f, 0.00907307f, -0.0244004f, -0.0152191f, -0.0259063f, 0.00914318f, 0.00415119f, 0.017147f, 0.0134203f, -0.013869f, 0.0287268f, -0.00334694f, 0.00733397f, -0.0287926f, -0.0186926f, 0.0193662f, -0.0115437f, 0.00422612f, -0.0345232f, 0.00223253f, -0.00957321f, 0.0210624f, 0.013331f, 0.0150954f, 0.0216801f}}, {19, {-0.0531632f, -0.0118138f, 0.0870833f, 0.0347929f, -0.076144f, -0.0659219f, -0.0463811f, 0.0141307f, -0.0127706f, -0.03782f, -0.00402401f, -0.00571876f, -0.187957f, -0.0247127f, 0.0711425f, 0.008244f, 0.0492649f, 0.126972f, 0.0933097f, 0.29848f, -0.0966178f, -0.114417f, 0.0387229f, 0.0453255f, -0.181286f, -0.0651251f, -0.0996879f, -0.00276995f, 0.0617558f, -0.0100728f, 0.056304f, -0.077416f, -0.162858f, -0.0541251f, 0.0571202f, -0.0525331f, 0.0724297f, 0.171029f, 0.141738f, 0.295483f}}, {21, {0.0f}}, {22, {0.0f}}},
+ // int -> INT32 map
+ {{20, {4}}},
+ // int -> QUANT8_ASYMM map
+ {}
+},
+//Output(s)
+{ // See tools/test_generator/include/TestHarness.h:MixedTyped
+ // int -> FLOAT32 map
+ {{1, {-0.0166936f, 0.0381209f, 0.000889684f, 0.0143363f, -0.0328911f, -0.0234288f, 0.0333051f, -0.012229f, 0.0110322f, -0.0457725f, -0.000832209f, -0.0202817f, 0.0327257f, 0.0121309f, 0.0155969f, 0.0312091f, -0.0141913f, 0.0322082f, 0.00227024f, 0.0260507f, -0.0188721f, -0.0296489f, 0.0399134f, -0.0160509f, 0.011604f, -0.0447318f, -0.0150515f, -0.0277406f, 0.0316596f, 0.0118233f, 0.0214762f, 0.0293641f}}, {2, {-0.154022f, -0.124934f, 0.0478463f, 0.0607819f, -0.218727f, -0.111053f, -0.103885f, -0.00447221f, 0.0554757f, -0.0207068f, 0.0595767f, -0.116297f, -0.249466f, -0.0723206f, 0.0794942f, -0.0377107f, 0.124532f, 0.249952f, 0.188641f, 0.411865f, -0.11012f, -0.0694494f, 0.103501f, 0.0428427f, -0.167345f, -0.106061f, -0.0775679f, 0.00936161f, 0.0105526f, -0.0314523f, 0.0243475f, -0.132179f, -0.258763f, -0.0307266f, 0.107047f, -0.0115197f, 0.0995485f, 0.220027f, 0.158355f, 0.436369f}}, {3, {-0.0166936f, 0.0381209f, 0.000889694f, 0.0143363f, -0.0328911f, -0.0234288f, 0.0333051f, -0.012229f, 0.0110322f, -0.0457725f, -0.000832209f, -0.0202817f, 0.0327257f, 0.0121308f, 0.0155969f, 0.0312091f, -0.0141913f, 0.0322082f, 0.00227024f, 0.0260507f, -0.0188721f, -0.0296489f, 0.0399134f, -0.0160509f, 0.0116039f, -0.0447318f, -0.0150515f, -0.0277406f, 0.0316596f, 0.0118233f, 0.0214762f, 0.0293641f}}, {0, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}},
+ // int -> INT32 map
+ {},
+ // int -> QUANT8_ASYMM map
+ {}
+}
+}, // End of an example
diff --git a/nn/runtime/test/generated/examples/lstm3_state2.example.cpp b/nn/runtime/test/generated/examples/lstm3_state2.example.cpp
new file mode 100644
index 000000000..770143bd1
--- /dev/null
+++ b/nn/runtime/test/generated/examples/lstm3_state2.example.cpp
@@ -0,0 +1,22 @@
+// Generated file (from: lstm3_state2.mod.py). Do not edit
+// Begin of an example
+{
+//Input(s)
+{ // See tools/test_generator/include/TestHarness.h:MixedTyped
+ // int -> FLOAT32 map
+ {{0, {0.073204f, 0.296072f, 0.743333f, 0.069199f, 0.045348f, 0.640394f, 0.930399f, 0.050782f, 0.432485f, 0.988078f}}, {1, {0.021393683f, 0.06124551f, 0.046905167f, -0.014657677f, -0.03149463f, 0.09171803f, 0.14647801f, 0.10797193f, -0.0057968358f, 0.0019193048f, -0.2726754f, 0.10154029f, -0.018539885f, 0.080349885f, -0.10262385f, -0.022599787f, -0.09121155f, -0.008675967f, -0.045206103f, -0.0821282f, -0.008045952f, 0.015478081f, 0.055217247f, 0.038719587f, 0.044153627f, -0.06453243f, 0.05031825f, -0.046935108f, -0.008164439f, 0.014574226f, -0.1671009f, -0.15519552f, -0.16819797f, -0.13971269f, -0.11953059f, 0.25005487f, -0.22790983f, 0.009855087f, -0.028140958f, -0.11200698f, 0.11295408f, -0.0035217577f, 0.054485075f, 0.05184695f, 0.064711206f, 0.10989193f, 0.11674786f, 0.03490607f, 0.07727357f, 0.11390585f, -0.1863375f, -0.1034451f, -0.13945189f, -0.049401227f, -0.18767063f, 0.042483903f, 0.14233552f, 0.13832581f, 0.18350165f, 0.14545603f, -0.028545704f, 0.024939531f, 0.050929718f, 0.0076203286f, -0.0029723682f, -0.042484224f, -0.11827596f, -0.09171104f, -0.10808628f, -0.16327988f, -0.2273378f, -0.0993647f, -0.017155107f, 0.0023917493f, 0.049272764f, 0.0038534778f, 0.054764505f, 0.089753784f, 0.06947234f, 0.08014476f, -0.04544234f, -0.0497073f, -0.07135631f, -0.048929106f, -0.004042012f, -0.009284026f, 0.018042054f, 0.0036860977f, -0.07427302f, -0.11434604f, -0.018995456f, 0.031487543f, 0.012834908f, 0.019977754f, 0.044256654f, -0.39292613f, -0.18519334f, -0.11651281f, -0.06809892f, 0.011373677f}}, {2, {-0.0018401089f, -0.004852237f, 0.03698424f, 0.014181704f, 0.028273236f, -0.016726194f, -0.05249759f, -0.10204261f, 0.00861066f, -0.040979505f, -0.009899187f, 0.01923892f, -0.028177269f, -0.08535103f, -0.14585495f, 0.10662567f, -0.01909731f, -0.017883534f, -0.0047269356f, -0.045103323f, 0.0030784295f, 0.076784775f, 0.07463696f, 0.094531395f, 0.0814421f, -0.12257899f, -0.033945758f, -0.031303465f, 0.045630626f, 0.06843887f, -0.13492945f, -0.012480007f, -0.0811829f, -0.07224499f, -0.09628791f, 0.045100946f, 0.0012300825f, 0.013964662f, 0.099372394f, 0.02543059f, 0.06958324f, 0.034257296f, 0.0482646f, 0.06267997f, 0.052625068f, 0.12784666f, 0.07077897f, 0.025725935f, 0.04165009f, 0.07241905f, 0.018668644f, -0.037377294f, -0.06277783f, -0.08833636f, -0.040120605f, -0.011405586f, -0.007808335f, -0.010301386f, -0.005102167f, 0.027717464f, 0.05483423f, 0.11449111f, 0.11289652f, 0.10939839f, 0.13396506f, -0.08402166f, -0.01901462f, -0.044678304f, -0.07720565f, 0.014350063f, -0.11757958f, -0.0652038f, -0.08185733f, -0.076754324f, -0.092614375f, 0.10405491f, 0.052960336f, 0.035755895f, 0.035839386f, -0.012540553f, 0.036881298f, 0.02913376f, 0.03420159f, 0.05448447f, -0.054523353f, 0.02582715f, 0.02327355f, -0.011857179f, -0.0011980024f, -0.034641717f, -0.026125094f, -0.17582615f, -0.15923657f, -0.27486774f, -0.0006143371f, 0.0001771948f, -8.470171e-05f, 0.02651807f, 0.045790765f, 0.06956496f}}, {3, {-0.04580283f, -0.09549462f, -0.032418985f, -0.06454633f, -0.043528453f, 0.043018587f, -0.049152344f, -0.12418144f, -0.078985475f, -0.07596889f, 0.019484362f, -0.11434962f, -0.0074034138f, -0.06314844f, -0.092981495f, 0.0062155537f, -0.025034338f, -0.0028890965f, 0.048929527f, 0.06235075f, 0.10665918f, -0.032036792f, -0.08505916f, -0.10843358f, -0.13002433f, -0.036816437f, -0.02130134f, -0.016518239f, 0.0047691227f, -0.0025825808f, 0.066017866f, 0.029991534f, -0.10652836f, -0.1037554f, -0.13056071f, -0.03266643f, -0.033702414f, -0.006473424f, -0.04611692f, 0.014419339f, -0.025174323f, 0.0396852f, 0.081777506f, 0.06157468f, 0.10210095f, -0.009658194f, 0.046511717f, 0.03603906f, 0.0069369148f, 0.015960095f, -0.06507666f, 0.09551598f, 0.053568836f, 0.06408714f, 0.12835667f, -0.008714329f, -0.20211966f, -0.12093674f, 0.029450472f, 0.2849013f, -0.029227901f, 0.1164364f, -0.08560263f, 0.09941786f, -0.036999565f, -0.028842626f, -0.0033637602f, -0.017012902f, -0.09720865f, -0.11193351f, -0.029155117f, -0.017936034f, -0.009768936f, -0.04223324f, -0.036159635f, 0.06505112f, -0.021742892f, -0.023377212f, -0.07221364f, -0.06430552f, 0.05453865f, 0.091149814f, 0.06387331f, 0.007518393f, 0.055960953f, 0.069779344f, 0.046411168f, 0.10509911f, 0.07463894f, 0.0075130584f, 0.012850982f, 0.04555431f, 0.056955688f, 0.06555285f, 0.050801456f, -0.009862683f, 0.00826772f, -0.026555609f, -0.0073611983f, -0.0014897042f}}, {4, {-0.0998932f, -0.07201956f, -0.052803773f, -0.15629593f, -0.15001918f, -0.07650751f, 0.02359855f, -0.075155355f, -0.08037709f, -0.15093534f, 0.029517552f, -0.04751393f, 0.010350531f, -0.02664851f, -0.016839722f, -0.023121163f, 0.0077019283f, 0.012851257f, -0.05040649f, -0.0129761f, -0.021737747f, -0.038305793f, -0.06870586f, -0.01481247f, -0.001285394f, 0.10124236f, 0.083122835f, 0.053313006f, -0.062235646f, -0.075637154f, -0.027833903f, 0.029774971f, 0.1130802f, 0.09218906f, 0.09506135f, -0.086665764f, -0.037162706f, -0.038880914f, -0.035832845f, -0.014481564f, -0.09825003f, -0.12048569f, -0.097665586f, -0.05287633f, -0.0964047f, -0.11366429f, 0.035777505f, 0.13568819f, 0.052451383f, 0.050649304f, 0.05798951f, -0.021852335f, -0.099848844f, 0.014740475f, -0.078897946f, 0.04974699f, 0.014160473f, 0.06973932f, 0.04964942f, 0.033364646f, 0.08190124f, 0.025535367f, 0.050893165f, 0.048514254f, 0.06945813f, -0.078907564f, -0.06707616f, -0.11844508f, -0.09986688f, -0.07509403f, 0.06263226f, 0.14925587f, 0.20188436f, 0.12098451f, 0.14639415f, 0.0015017595f, -0.014267382f, -0.03417257f, 0.012711468f, 0.0028300495f, -0.024758482f, -0.05098548f, -0.0821182f, 0.014225672f, 0.021544158f, 0.08949725f, 0.07505268f, -0.0020780868f, 0.04908258f, 0.06476295f, -0.022907063f, 0.027562456f, 0.040185735f, 0.019567577f, -0.015598739f, -0.049097303f, -0.017121866f, -0.083368234f, -0.02332002f, -0.0840956f}}, {5, {-0.001374326f, -0.078856036f, 0.10672688f, 0.029162422f, -0.11585556f, 0.02557986f, -0.13446963f, -0.035785314f, -0.01244275f, 0.025961924f, -0.02337298f, -0.044228926f, -0.055839065f, -0.046598054f, -0.010546039f, -0.06900766f, 0.027239809f, 0.022582639f, -0.013296484f, -0.05459212f, 0.08981f, -0.045407712f, 0.08682226f, -0.06867011f, -0.14390695f, -0.02916037f, 0.000996957f, 0.091420636f, 0.14283475f, -0.07390571f, -0.06402044f, 0.062524505f, -0.093129106f, 0.04860203f, -0.08364217f, -0.08119002f, 0.009352075f, 0.22920375f, 0.0016303885f, 0.11583097f, -0.13732095f, 0.012405723f, -0.07551853f, 0.06343048f, 0.12162708f, -0.031923793f, -0.014335606f, 0.01790974f, -0.10650317f, -0.0724401f, 0.08554849f, -0.05727212f, 0.06556731f, -0.042729504f, -0.043227166f, 0.011683251f, -0.013082158f, -0.029302018f, -0.010899579f, -0.062036745f, -0.022509435f, -0.00964907f, -0.01567329f, 0.04260106f, -0.07787477f, -0.11576462f, 0.017356863f, 0.048673786f, -0.017577527f, -0.05527947f, -0.082487635f, -0.040137455f, -0.10820036f, -0.04666372f, 0.022746278f, -0.07851417f, 0.01068115f, 0.032956902f, 0.022433773f, 0.0026891115f, 0.08944216f, -0.0685835f, 0.010513544f, 0.07228705f, 0.02032331f, -0.059686817f, -0.0005566496f, -0.086984694f, 0.040414046f, -0.1380399f, 0.094208956f, -0.05722982f, 0.012092817f, -0.04989123f, -0.086576f, -0.003399834f, -0.04696032f, -0.045747425f, 0.10091314f, 0.048676282f, -0.029037097f, 0.031399418f, -0.0040285117f, 0.047237843f, 0.09504992f, 0.041799378f, -0.049185462f, -0.031518843f, -0.10516937f, 0.026374253f, 0.10058866f, -0.0033195973f, -0.041975245f, 0.0073591834f, 0.0033782164f, -0.004325073f, -0.10167381f, 0.042500053f, -0.01447153f, 0.06464186f, -0.017142897f, 0.03312627f, 0.009205989f, 0.024138335f, -0.011337001f, 0.035530265f, -0.010912711f, 0.0706555f, -0.005894094f, 0.051841937f, -0.1401738f, -0.02351249f, 0.0365468f, 0.07590991f, 0.08838724f, 0.021681072f, -0.10086113f, 0.019608743f, -0.06195883f, 0.077335775f, 0.023646897f, -0.095322326f, 0.02233014f, 0.09756986f, -0.048691444f, -0.009579111f, 0.07595467f, 0.11480546f, -0.09801813f, 0.019894179f, 0.08502348f, 0.004032281f, 0.037211012f, 0.068537936f, -0.048005626f, -0.091520436f, -0.028379958f, -0.01556313f, 0.06554592f, -0.045599163f, -0.01672207f, -0.020169014f, -0.011877351f, -0.20212261f, 0.010889619f, 0.0047078193f, 0.038385306f, 0.08540671f, -0.017140968f, -0.0035865551f, 0.016678626f, 0.005633034f, 0.015963363f, 0.00871737f, 0.060130805f, 0.028611384f, 0.10109069f, -0.015060172f, -0.07894427f, 0.06401885f, 0.011584063f, -0.024466386f, 0.0047652307f, -0.09041358f, 0.030737216f, -0.0046374933f, 0.14215417f, -0.11823516f, 0.019899689f, 0.006106124f, -0.027092824f, 0.0786356f, 0.05052217f, -0.058925f, -0.011402121f, -0.024987547f, -0.0013661642f, -0.06832946f, -0.015667673f, -0.1083353f, -0.00096863037f, -0.06988685f, -0.053350925f, -0.027275559f, -0.033664223f, -0.07978348f, -0.025200296f, -0.017207067f, -0.058403496f, -0.055697463f, 0.005798788f, 0.12965427f, -0.062582195f, 0.0013350133f, -0.10482091f, 0.0379771f, 0.072521195f, -0.0029455067f, -0.13797039f, -0.03628521f, 0.013806405f, -0.017858358f, -0.01008298f, -0.07700066f, -0.017081132f, 0.019358726f, 0.0027079724f, 0.004635139f, 0.062634714f, -0.02338735f, -0.039547626f, -0.02050681f, 0.03385117f, -0.083611414f, 0.002862572f, -0.09421313f, 0.058618143f, -0.08598433f, 0.00972939f, 0.023867095f, -0.053934585f, -0.023203006f, 0.07452513f, -0.048767887f, -0.07314807f, -0.056307215f, -0.10433547f, -0.06440842f, 0.04328182f, 0.04389765f, -0.020006588f, -0.09076438f, -0.11652589f, -0.021705797f, 0.03345259f, -0.010329105f, -0.025767034f, 0.013057034f, -0.07316461f, -0.10145612f, 0.06358255f, 0.18531723f, 0.07759293f, 0.12006465f, 0.1305557f, 0.058638252f, -0.03393652f, 0.09622831f, -0.16253184f, -2.4580743e-06f, 0.079869635f, -0.070196845f, -0.005644518f, 0.06857898f, -0.12598175f, -0.035084512f, 0.03156317f, -0.12794146f, -0.031963028f, 0.04692781f, 0.030070418f, 0.0071660685f, -0.095516115f, -0.004643372f, 0.040170413f, -0.062104587f, -0.0037324072f, 0.0554317f, 0.08184801f, -0.019164372f, 0.06791302f, 0.034257166f, -0.10307039f, 0.021943003f, 0.046745934f, 0.0790918f, -0.0265588f, -0.007824208f, 0.042546265f, -0.00977924f, -0.0002440307f, -0.017384544f, -0.017990116f, 0.12252321f, -0.014512694f, -0.08251313f, 0.08861942f, 0.13589665f, 0.026351685f, 0.012641483f, 0.07466548f, 0.044301085f, -0.045414884f, -0.051112458f, 0.03444247f, -0.08502782f, -0.04106223f, -0.028126027f, 0.028473156f, 0.10467447f}}, {6, {-0.057784554f, -0.026057621f, -0.068447545f, -0.022581743f, 0.14811787f, 0.10826372f, 0.09471067f, 0.03987225f, -0.0039523416f, 0.00030638507f, 0.053185795f, 0.10572994f, 0.08414449f, -0.022036452f, -0.00066928595f, -0.09203576f, 0.032950465f, -0.10985798f, -0.023809856f, 0.0021431844f, -0.02196096f, -0.00326074f, 0.00058621005f, -0.074678116f, -0.06193199f, 0.055729095f, 0.03736828f, 0.020123724f, 0.061878487f, -0.04729229f, 0.034919553f, -0.07585433f, -0.04421272f, -0.044019096f, 0.085488975f, 0.04058006f, -0.06890133f, -0.030951202f, -0.024628663f, -0.07672815f, 0.034293607f, 0.08556707f, -0.05293577f, -0.033561368f, -0.04899627f, 0.0241671f, 0.015736353f, -0.095442444f, -0.029564252f, 0.016493602f, -0.035026584f, 0.022337519f, -0.026871363f, 0.004780428f, 0.0077918363f, -0.03601621f, 0.016435321f, -0.03263031f, -0.09543275f, -0.047392778f, 0.013454138f, 0.028934088f, 0.01685226f, -0.086110644f, -0.046250615f, -0.01847454f, 0.047608484f, 0.07339695f, 0.034546845f, -0.04881143f, 0.009128804f, -0.08802852f, 0.03761666f, 0.008096139f, -0.014454086f, 0.014361001f, -0.023502491f, -0.0011840804f, -0.07607001f, 0.001856849f, -0.06509276f, -0.006021153f, -0.08570962f, -0.1451793f, 0.060212336f, 0.055259194f, 0.06974018f, 0.049454916f, -0.027794661f, -0.08077226f, -0.016179763f, 0.1169753f, 0.17213494f, -0.0056326236f, -0.053934924f, -0.0124349f, -0.11520337f, 0.05409887f, 0.088759385f, 0.0019655675f, 0.0042065294f, 0.03881498f, 0.019844765f, 0.041858196f, -0.05695512f, 0.047233116f, 0.038937137f, -0.06542224f, 0.014429736f, -0.09719407f, 0.13908425f, -0.05379757f, 0.012321099f, 0.082840554f, -0.029899208f, 0.044217527f, 0.059855383f, 0.07711018f, -0.045319796f, 0.0948846f, -0.011724666f, -0.0033288454f, -0.033542685f, -0.04764985f, -0.13873616f, 0.040668588f, 0.034832682f, -0.015319203f, -0.018715994f, 0.046002675f, 0.0599172f, -0.043107376f, 0.0294216f, -0.002314414f, -0.022424703f, 0.0030315618f, 0.0014641669f, 0.0029166266f, -0.11878115f, 0.013738511f, 0.12375372f, -0.0006038222f, 0.029104086f, 0.087442465f, 0.052958444f, 0.07558703f, 0.04817258f, 0.044462286f, -0.015213451f, -0.08783778f, -0.0561384f, -0.003008196f, 0.047060397f, -0.002058388f, 0.03429439f, -0.018839769f, 0.024734668f, 0.024614193f, -0.042046934f, 0.09597743f, -0.0043254104f, 0.04320769f, 0.0064070094f, -0.0019131786f, -0.02558259f, -0.022822596f, -0.023273505f, -0.02464396f, -0.10991725f, -0.006240552f, 0.0074488563f, 0.024044557f, 0.04383914f, -0.046476185f, 0.028658995f, 0.060410924f, 0.050786525f, 0.009452605f, -0.0073054377f, -0.024810238f, 0.0052906186f, 0.0066939713f, -0.0020913032f, 0.014515517f, 0.015898481f, 0.021362653f, -0.030262267f, 0.016587038f, -0.011442813f, 0.041154444f, -0.007631438f, -0.03423484f, -0.010977775f, 0.036152758f, 0.0066366293f, 0.11915515f, 0.02318443f, -0.041350313f, 0.021485701f, -0.10906167f, -0.028218046f, -0.00954771f, 0.020531068f, -0.11995105f, -0.03672871f, 0.024019798f, 0.014255957f, -0.05221243f, -0.00661567f, -0.04630967f, 0.033188973f, 0.10107534f, -0.014027541f, 0.030796422f, -0.10270911f, -0.035999842f, 0.15443139f, 0.07684145f, 0.036571592f, -0.035900835f, -0.0034699554f, 0.06209149f, 0.015920248f, -0.031122351f, -0.03858649f, 0.01849943f, 0.13872518f, 0.01503974f, 0.069941424f, -0.06948533f, -0.0088794185f, 0.061282158f, -0.047401894f, 0.03100163f, -0.041533746f, -0.10430945f, 0.044574402f, -0.01425562f, -0.024290353f, 0.034563623f, 0.05866852f, 0.023947537f, -0.09445152f, 0.035450947f, 0.02247216f, -0.0042998926f, 0.061146557f, -0.10250651f, 0.020881841f, -0.06747029f, 0.10062043f, -0.0023941975f, 0.03532124f, -0.016341697f, 0.09685456f, -0.016764693f, 0.051808182f, 0.05875331f, -0.04536488f, 0.001626336f, -0.028892258f, -0.01048663f, -0.009793449f, -0.017093895f, 0.010987891f, 0.02357273f, -0.00010856845f, 0.0099760275f, -0.001845119f, -0.03551521f, 0.0018358806f, 0.05763657f, -0.01769146f, 0.040995963f, 0.02235177f, -0.060430344f, 0.11475477f, -0.023854522f, 0.10071741f, 0.0686208f, -0.014250481f, 0.034261297f, 0.047418304f, 0.08562733f, -0.030519066f, 0.0060542435f, 0.014653856f, -0.038836084f, 0.04096551f, 0.032249358f, -0.08355519f, -0.026823482f, 0.056386515f, -0.010401743f, -0.028396193f, 0.08507674f, 0.014410365f, 0.020995233f, 0.17040324f, 0.11511526f, 0.02459721f, 0.0066619175f, 0.025853224f, -0.023133837f, -0.081302024f, 0.017264642f, -0.009585969f, 0.09491168f, -0.051313367f, 0.054532815f, -0.014298593f, 0.10657464f, 0.007076659f, 0.10964551f, 0.0409152f, 0.008275321f, -0.07283536f, 0.07937492f, 0.04192024f, -0.1075027f}}, {7, {-0.037322544f, 0.018592842f, 0.0056175636f, -0.06253426f, 0.055647098f, -0.05713207f, -0.05626563f, 0.005559383f, 0.03375411f, -0.025757805f, -0.088049285f, 0.06017052f, -0.06570978f, 0.007384076f, 0.035123326f, -0.07920549f, 0.053676967f, 0.044480428f, -0.07663568f, 0.0071805613f, 0.08089997f, 0.05143358f, 0.038261272f, 0.03339287f, -0.027673481f, 0.044746667f, 0.028349208f, 0.020090483f, -0.019443132f, -0.030755889f, -0.0040000007f, 0.04465846f, -0.021585021f, 0.0031670958f, 0.0053199246f, -0.056117613f, -0.10893326f, 0.076739706f, -0.08509834f, -0.027997585f, 0.037871376f, 0.01449768f, -0.09002357f, -0.06111149f, -0.046195522f, 0.0422062f, -0.005683705f, -0.1253618f, -0.012925729f, -0.04890792f, 0.06985068f, 0.037654128f, 0.03398274f, -0.004781977f, 0.007032333f, -0.031787455f, 0.010868644f, -0.031489216f, 0.09525667f, 0.013939797f, 0.0058680447f, 0.0167067f, 0.02668468f, -0.04797466f, -0.048885044f, -0.12722108f, 0.035304096f, 0.06554885f, 0.00972396f, -0.039238118f, -0.05159735f, -0.11329045f, 0.1613692f, -0.03750952f, 0.06529313f, -0.071974665f, -0.11769596f, 0.015524369f, -0.0013754242f, -0.12446318f, 0.02786344f, -0.014179351f, 0.005264273f, 0.14376344f, 0.015983658f, 0.03406988f, -0.06939408f, 0.040699873f, 0.02111075f, 0.09669095f, 0.041345075f, -0.08316494f, -0.07684199f, -0.045768797f, 0.032298047f, -0.041805092f, 0.0119405f, 0.0061010392f, 0.12652606f, 0.0064572375f, -0.024950314f, 0.11574242f, 0.04508852f, -0.04335324f, 0.06760663f, -0.027437469f, 0.07216407f, 0.06977076f, -0.05438599f, 0.034033038f, -0.028602652f, 0.05346137f, 0.043184172f, -0.037189785f, 0.10420091f, 0.00882477f, -0.054019816f, -0.074273005f, -0.030617684f, -0.0028467078f, 0.024302477f, -0.0038869337f, 0.005332455f, 0.0013399826f, 0.04361412f, -0.007001822f, 0.09631092f, -0.06702025f, -0.042049985f, -0.035070654f, -0.04103342f, -0.10273396f, 0.0544271f, 0.037184782f, -0.13150354f, -0.0058036847f, -0.008264958f, 0.042035464f, 0.05891794f, 0.029673764f, 0.0063542654f, 0.044788733f, 0.054816857f, 0.062257513f, -0.00093483756f, 0.048938446f, -0.004952862f, -0.007730018f, -0.04043371f, -0.017094059f, 0.07229206f, -0.023670016f, -0.052195564f, -0.025616996f, -0.01520939f, 0.045104615f, -0.007376126f, 0.003533447f, 0.006570588f, 0.056037236f, 0.12436656f, 0.051817212f, 0.028532185f, -0.08686856f, 0.11868599f, 0.07663395f, -0.07323171f, 0.03463402f, -0.050708205f, -0.04458982f, -0.11590894f, 0.021273347f, 0.1251325f, -0.15313013f, -0.12224372f, 0.17228661f, 0.023029093f, 0.086124025f, 0.006445803f, -0.03496501f, 0.028332196f, 0.04449512f, -0.042436164f, -0.026587414f, -0.006041347f, -0.09292539f, -0.05678812f, 0.03897832f, 0.09465633f, 0.008115513f, -0.02171956f, 0.08304309f, 0.071401566f, 0.019622514f, 0.032163795f, -0.004167056f, 0.02295182f, 0.030739572f, 0.056506045f, 0.004612461f, 0.06524936f, 0.059999723f, 0.046395954f, -0.0045512207f, -0.1335546f, -0.030136576f, 0.11584653f, -0.014678886f, 0.0020118146f, -0.09688814f, -0.0790206f, 0.039770417f, -0.0329582f, 0.07922767f, 0.029322514f, 0.026405897f, 0.04207835f, -0.07073373f, 0.063781224f, 0.0859677f, -0.10925287f, -0.07011058f, 0.048005477f, 0.03438226f, -0.09606514f, -0.006669445f, -0.043381985f, 0.04240257f, -0.06955775f, -0.06769346f, 0.043903265f, -0.026784198f, -0.017840602f, 0.024307009f, -0.040079936f, -0.019946516f, 0.045318738f, -0.12233574f, 0.026170589f, 0.0074471775f, 0.15978073f, 0.10185836f, 0.10298046f, -0.015476589f, -0.039390966f, -0.072174534f, 0.0739445f, -0.1211869f, -0.0347889f, -0.07943156f, 0.014809798f, -0.12412325f, -0.0030663363f, 0.039695457f, 0.0647603f, -0.08291318f, -0.018529687f, -0.004423833f, 0.0037507233f, 0.084633216f, -0.01514876f, -0.056505352f, -0.012800942f, -0.06994386f, 0.012962922f, -0.031234352f, 0.07029052f, 0.016418684f, 0.03618972f, 0.055686004f, -0.08663945f, -0.017404709f, -0.054761406f, 0.029065743f, 0.052404847f, 0.020238016f, 0.0048197987f, -0.0214882f, 0.07078733f, 0.013016777f, 0.06262858f, 0.009184685f, 0.020785125f, -0.043904778f, -0.0270329f, -0.03299152f, -0.060088247f, -0.015162964f, -0.001828936f, 0.12642565f, -0.056757294f, 0.013586685f, 0.09232601f, -0.035886683f, 0.06000002f, 0.05229691f, -0.052580316f, -0.082029596f, -0.010794592f, 0.012947712f, -0.036429964f, -0.085508935f, -0.13127148f, -0.017744139f, 0.031502828f, 0.036232427f, -0.031581745f, 0.023051167f, -0.05325106f, -0.03421577f, 0.028793324f, -0.034633752f, -0.009881397f, -0.043551125f, -0.018609839f, 0.0019097115f, -0.008799762f, 0.056595087f, 0.0022273948f, 0.055752404f}}, {8, {0.025825322f, -0.05813119f, 0.09495884f, -0.045984812f, -0.01255415f, -0.0026479573f, -0.08196161f, -0.054914974f, -0.0046604523f, -0.029587349f, -0.044576716f, -0.07480124f, -0.082868785f, 0.023254942f, 0.027502948f, -0.0039728214f, -0.08683098f, -0.08116779f, -0.014675607f, -0.037924774f, -0.023314456f, -0.007401714f, -0.09255757f, 0.029460307f, -0.08829125f, -0.005139627f, -0.08989442f, -0.0555066f, 0.13596267f, -0.025062224f, -0.048351806f, -0.03850004f, 0.07266485f, -0.022414139f, 0.05940088f, 0.075114764f, 0.09597592f, -0.010211725f, -0.0049794707f, -0.011523867f, -0.025980417f, 0.072999895f, 0.11091378f, -0.081685916f, 0.014416728f, 0.043229222f, 0.034178585f, -0.07530371f, 0.035837382f, -0.085607f, -0.007721233f, -0.03287832f, -0.043848954f, -0.06404588f, -0.06632928f, -0.073643476f, 0.008214239f, -0.045984086f, 0.039764922f, 0.03474462f, 0.060612556f, -0.080590084f, 0.049127717f, 0.04151091f, -0.030063879f, 0.008801774f, -0.023021035f, -0.019558564f, 0.05158114f, -0.010947698f, -0.011825728f, 0.0075720972f, 0.0699727f, -0.0039981045f, 0.069350146f, 0.08799282f, 0.016156472f, 0.035502106f, 0.11695009f, 0.006217345f, 0.13392477f, -0.037875112f, 0.025745004f, 0.08940699f, -0.00924166f, 0.0046702605f, -0.036598757f, -0.08811812f, 0.10522024f, -0.032441203f, 0.008176899f, -0.04454919f, 0.07058152f, 0.0067963637f, 0.039206743f, 0.03259838f, 0.03725492f, -0.09515802f, 0.013326398f, -0.052055415f, -0.025676316f, 0.03198509f, -0.015951829f, -0.058556724f, 0.036879618f, 0.043357447f, 0.028362012f, -0.05908629f, 0.0059240665f, -0.04995891f, -0.019187413f, 0.0276265f, -0.01628143f, 0.0025863599f, 0.08800015f, 0.035250366f, -0.022165963f, -0.07328642f, -0.009415526f, -0.07455109f, 0.11690406f, 0.0363299f, 0.07411125f, 0.042103454f, -0.009660886f, 0.019076364f, 0.018299393f, -0.046004917f, 0.08891175f, 0.0431396f, -0.026327137f, -0.051502608f, 0.08979574f, -0.051670972f, 0.04940282f, -0.07491107f, -0.021240504f, 0.022596184f, -0.034280192f, 0.060163025f, -0.058211457f, -0.051837247f, -0.01349775f, -0.04639988f, -0.035936575f, -0.011681591f, 0.064818054f, 0.0073146066f, -0.021745546f, -0.043124277f, -0.06471268f, -0.07053354f, -0.029321948f, -0.05330136f, 0.016933719f, -0.053782392f, 0.13747959f, -0.1361751f, -0.11569455f, 0.0033329215f, 0.05693899f, -0.053219706f, 0.063698f, 0.07977434f, -0.07924483f, 0.06936997f, 0.0034815092f, -0.007305279f, -0.037325785f, -0.07251102f, -0.033633437f, -0.08677009f, 0.091591336f, -0.14165086f, 0.021752775f, 0.019683983f, 0.0011612234f, -0.058154266f, 0.049996935f, 0.0288841f, -0.0024567875f, -0.14345716f, 0.010955264f, -0.10234828f, 0.1183656f, -0.0010731248f, -0.023590032f, -0.072285876f, -0.0724771f, -0.026382286f, -0.0014920527f, 0.042667855f, 0.0018776858f, 0.02986552f, 0.009814309f, 0.0733756f, 0.12289186f, 0.018043943f, -0.0458958f, 0.049412545f, 0.033632483f, 0.05495232f, 0.036686596f, -0.013781798f, -0.010036754f, 0.02576849f, -0.08307328f, 0.010112348f, 0.042521734f, -0.05869831f, -0.071689695f, 0.03876447f, -0.13275425f, -0.0352966f, -0.023077697f, 0.10285965f, 0.084736146f, 0.15568255f, -0.00040734606f, 0.027835453f, -0.10292561f, -0.032401145f, 0.10053256f, -0.026142767f, -0.08271222f, -0.0030240538f, -0.016368777f, 0.1070414f, 0.042672627f, 0.013456989f, -0.0437609f, -0.022309763f, 0.11576483f, 0.04108048f, 0.061026827f, -0.0190714f, -0.0869359f, 0.037901703f, 0.0610107f, 0.07202949f, 0.01675338f, 0.086139716f, -0.08795751f, -0.014898893f, -0.023771819f, -0.01965048f, 0.007955471f, -0.043740474f, 0.03346837f, -0.10549954f, 0.090567775f, 0.042013682f, -0.03176985f, 0.12569028f, -0.02421228f, -0.029526481f, 0.023851605f, 0.031539805f, 0.05292009f, -0.02344001f, -0.07811758f, -0.08834428f, 0.10094801f, 0.16594367f, -0.06861939f, -0.021256343f, -0.041093912f, -0.06669611f, 0.035498552f, 0.021757556f, -0.09302526f, -0.015403468f, -0.06614931f, -0.051798206f, -0.013874718f, 0.03630673f, 0.010412845f, -0.08077351f, 0.046185967f, 0.0035662893f, 0.03541868f, -0.094149634f, -0.034814864f, 0.003128424f, -0.020674974f, -0.03944324f, -0.008110165f, -0.11113267f, 0.08484226f, 0.043586485f, 0.040582247f, 0.0968012f, -0.065249965f, -0.028036479f, 0.0050708856f, 0.0017462453f, 0.0326779f, 0.041296225f, 0.09164146f, -0.047743853f, -0.015952192f, -0.034451712f, 0.084197424f, -0.05347844f, -0.11768019f, 0.085926116f, -0.08251791f, -0.045081906f, 0.0948852f, 0.068401024f, 0.024856757f, 0.06978981f, -0.057309967f, -0.012775832f, -0.0032452994f, 0.01977615f, -0.041040014f, -0.024264973f, 0.063464895f, 0.05431621f}}, {9, {0.040369894f, 0.030746894f, 0.24704495f, 0.018586371f, -0.037586458f, -0.15312155f, -0.11812848f, -0.11465643f, 0.20259799f, 0.11418174f, -0.10116027f, -0.011334949f, 0.12411352f, -0.076769054f, -0.052169047f, 0.21198851f, -0.38871562f, -0.09061183f, -0.09683246f, -0.21929175f}}, {10, {-0.01998659f, -0.15568835f, -0.24248174f, -0.012770197f, 0.041331276f, -0.072311886f, -0.052123554f, -0.0066330447f, -0.043891653f, 0.036225766f, -0.047248036f, 0.021479502f, 0.033189066f, 0.11952997f, -0.020432774f, 0.64658105f, -0.06650122f, -0.03467612f, 0.095340036f, 0.23647355f}}, {11, {0.08286371f, -0.08261836f, -0.51210177f, 0.002913762f, 0.17764764f, -0.5495371f, -0.08460716f, -0.24552552f, 0.030037103f, 0.04123544f, -0.11940523f, 0.007358328f, 0.1890978f, 0.4833202f, -0.34441817f, 0.36312827f, -0.26375428f, 0.1457655f, -0.19724406f, 0.15548733f}}, {12, {0.02234832f, 0.14757581f, 0.18176508f, 0.10380666f, 0.053110216f, -0.06928846f, -0.13942584f, -0.11816189f, 0.19483899f, 0.03652339f, -0.10250295f, 0.036714908f, -0.18426876f, 0.036065217f, 0.21810818f, 0.02383196f, -0.043370757f, 0.08690144f, -0.04444982f, 0.00030581196f}}, {13, {0.035185695f, -0.042891346f, -0.03032477f, 0.23027696f, 0.11098921f, 0.15378423f, 0.09263801f, 0.09790885f, 0.09508917f, 0.061199076f, 0.07665568f, -0.015443159f, -0.03499149f, 0.046190713f, 0.08895977f, 0.10899629f, 0.40694186f, 0.06030037f, 0.012413437f, -0.06108739f}}, {14, {-0.024379363f, 0.0055531194f, 0.23377132f, 0.033463873f, -0.1483596f, -0.10639995f, -0.091433935f, 0.058573797f, -0.06809782f, -0.07889636f, -0.043246906f, -0.09829136f, -0.4279842f, 0.034901652f, 0.18797937f, 0.0075234566f, 0.016178843f, 0.1749513f, 0.13975595f, 0.92058027f}}, {15, {0.046159424f, -0.0012809046f, 0.03563469f, 0.12648113f, 0.027195795f, 0.35373217f, -0.018957434f, 0.008907322f, -0.0762701f, 0.12018895f, 0.04216877f, 0.0022856654f, 0.040952638f, 0.3147856f, 0.08225149f, -0.057416286f, -0.14995944f, -0.008040261f, 0.13208859f, 0.029760877f}}, {16, {-0.009802181f, 0.09401916f, 0.0717386f, -0.13895074f, 0.09641832f, 0.060420845f, 0.08539281f, 0.054285463f, 0.061395317f, 0.034448683f, -0.042991187f, 0.019801661f, -0.16840284f, -0.015726732f, -0.23041931f, -0.024478018f, -0.10959692f, -0.013875541f, 0.18600968f, -0.061274476f, 0.0138165f, -0.08160894f, -0.07661644f, 0.032372914f, 0.16169067f, 0.22465782f, -0.03993472f, -0.004017731f, 0.08633481f, -0.28869787f, 0.08682067f, 0.17240396f, 0.014975425f, 0.056431185f, 0.031037588f, 0.16702051f, 0.0077946745f, 0.15140012f, 0.29405436f, 0.120285f, -0.188994f, -0.027265169f, 0.043389652f, -0.022061434f, 0.014777949f, -0.20203483f, 0.094781205f, 0.19100232f, 0.13987629f, -0.036132768f, -0.06426278f, -0.05108664f, 0.13221376f, 0.009441198f, -0.16715929f, 0.15859416f, -0.040437475f, 0.050779544f, -0.022187516f, 0.012166504f, 0.027685808f, -0.07675938f, -0.0055694645f, -0.09444123f, 0.0046453946f, 0.050794356f, 0.10770313f, -0.20790008f, -0.07149004f, -0.11425117f, 0.008225835f, -0.035802525f, 0.14374903f, 0.15262283f, 0.048710253f, 0.1847461f, -0.007487823f, 0.11000021f, -0.09542012f, 0.22619456f, -0.029149994f, 0.08527916f, 0.009043713f, 0.0042746216f, 0.016261552f, 0.022461696f, 0.12689082f, -0.043589946f, -0.12035478f, -0.08361797f, -0.050666027f, -0.1248618f, -0.1275799f, -0.071875185f, 0.07377272f, 0.09944291f, -0.18897448f, -0.1593054f, -0.06526116f, -0.040107165f, -0.004618631f, -0.067624845f, -0.007576253f, 0.10727444f, 0.041546922f, -0.20424393f, 0.06907816f, 0.050412357f, 0.00724631f, 0.039827548f, 0.12449835f, 0.10747581f, 0.13708383f, 0.09134148f, -0.12617786f, -0.06428341f, 0.09956831f, 0.1208086f, -0.14676677f, -0.0727722f, 0.1126304f, 0.010139365f, 0.015571211f, -0.038128063f, 0.022913318f, -0.042050496f, 0.16842307f, -0.060597885f, 0.10531834f, -0.06411776f, -0.07451711f, -0.03410368f, -0.13393489f, 0.06534304f, 0.003620307f, 0.04490757f, 0.05970546f, 0.05197996f, 0.02839995f, 0.10434969f, -0.013699693f, -0.028353551f, -0.07260381f, 0.047201227f, -0.024575593f, -0.036445823f, 0.07155557f, 0.009672501f, -0.02328883f, 0.009533515f, -0.03606021f, -0.07421458f, -0.028082801f, -0.2678904f, -0.13221288f, 0.18419984f, -0.13012612f, -0.014588381f, -0.035059117f, -0.04824723f, 0.07830115f, -0.056184657f, 0.03277091f, 0.025466874f, 0.14494097f, -0.12522776f, -0.098633975f, -0.10766018f, -0.08317623f, 0.08594209f, 0.07749552f, 0.039474737f, 0.1776665f, -0.07409566f, -0.0477268f, 0.29323658f, 0.10801441f, 0.1154011f, 0.013952499f, 0.10739139f, 0.10708251f, -0.051456142f, 0.0074137426f, -0.10430189f, 0.10034707f, 0.045594677f, 0.0635285f, -0.0715442f, -0.089667566f, -0.10811871f, 0.00026344223f, 0.08298446f, -0.009525053f, 0.006585689f, -0.24567553f, -0.09450807f, 0.09648481f, 0.026996298f, -0.06419476f, -0.04752702f, -0.11063944f, -0.23441927f, -0.17608605f, -0.052156363f, 0.067035615f, 0.19271925f, -0.0032889997f, -0.043264326f, 0.09663576f, -0.057112187f, -0.10100678f, 0.0628376f, 0.04447668f, 0.017961001f, -0.10094388f, -0.10190601f, 0.18335468f, 0.10494553f, -0.052095775f, -0.0026118709f, 0.10539724f, -0.04383912f, -0.042349473f, 0.08438151f, -0.1947263f, 0.02251204f, 0.11216432f, -0.10307853f, 0.17351969f, -0.039091777f, 0.08066188f, -0.00561982f, 0.12633002f, 0.11335965f, -0.0088127935f, -0.019777594f, 0.06864014f, -0.059751723f, 0.016233567f, -0.06894641f, -0.28651384f, -0.004228674f, 0.019708522f, -0.16305895f, -0.07468996f, -0.0855457f, 0.099339016f, -0.07580735f, -0.13775392f, 0.08434318f, 0.08330512f, -0.12131499f, 0.031935584f, 0.09180414f, -0.08876437f, -0.08049874f, 0.008753825f, 0.03498998f, 0.030215185f, 0.03907079f, 0.089751154f, 0.029194152f, -0.03337423f, -0.019092513f, 0.04331237f, 0.04299654f, -0.036394123f, -0.12915532f, 0.09793732f, 0.07512415f, -0.11319543f, -0.032502122f, 0.15661901f, 0.07671967f, -0.005491124f, -0.19379048f, -0.218606f, 0.21448623f, 0.017840758f, 0.1416943f, -0.07051762f, 0.19488361f, 0.02664691f, -0.18104725f, -0.09334311f, 0.15026465f, -0.15493552f, -0.057762887f, -0.11604192f, -0.262013f, -0.01391798f, 0.012185008f, 0.11156489f, -0.07483202f, 0.06693364f, -0.26151478f, 0.046425626f, 0.036540434f, -0.16435726f, 0.17338543f, -0.21401681f, -0.11385144f, -0.08283257f, -0.069031075f, 0.030635102f, 0.010969227f, 0.11109743f, 0.010919218f, 0.027526086f, 0.13519906f, 0.01891392f, -0.046839405f, -0.040167913f, 0.017953383f, -0.09700955f, 0.0061885654f, -0.07000971f, 0.026893595f, -0.038844477f, 0.14543656f}}, {17, {}}, {18, {-0.0166936f, 0.0381209f, 0.000889684f, 0.0143363f, -0.0328911f, -0.0234288f, 0.0333051f, -0.012229f, 0.0110322f, -0.0457725f, -0.000832209f, -0.0202817f, 0.0327257f, 0.0121309f, 0.0155969f, 0.0312091f, -0.0141913f, 0.0322082f, 0.00227024f, 0.0260507f, -0.0188721f, -0.0296489f, 0.0399134f, -0.0160509f, 0.011604f, -0.0447318f, -0.0150515f, -0.0277406f, 0.0316596f, 0.0118233f, 0.0214762f, 0.0293641f}}, {19, {-0.154022f, -0.124934f, 0.0478463f, 0.0607819f, -0.218727f, -0.111053f, -0.103885f, -0.00447221f, 0.0554757f, -0.0207068f, 0.0595767f, -0.116297f, -0.249466f, -0.0723206f, 0.0794942f, -0.0377107f, 0.124532f, 0.249952f, 0.188641f, 0.411865f, -0.11012f, -0.0694494f, 0.103501f, 0.0428427f, -0.167345f, -0.106061f, -0.0775679f, 0.00936161f, 0.0105526f, -0.0314523f, 0.0243475f, -0.132179f, -0.258763f, -0.0307266f, 0.107047f, -0.0115197f, 0.0995485f, 0.220027f, 0.158355f, 0.436369f}}, {21, {0.0f}}, {22, {0.0f}}},
+ // int -> INT32 map
+ {{20, {4}}},
+ // int -> QUANT8_ASYMM map
+ {}
+},
+//Output(s)
+{ // See tools/test_generator/include/TestHarness.h:MixedTyped
+ // int -> FLOAT32 map
+ {{1, {-0.0213783f, 0.0350169f, 0.000324787f, 0.0276012f, -0.0263374f, -0.0371449f, 0.0446149f, -0.0205474f, 0.0103729f, -0.0576349f, -0.0150052f, -0.0292043f, 0.0376827f, 0.0136115f, 0.0243435f, 0.0354492f, -0.0204549f, 0.0450315f, -0.00117379f, 0.0167673f, -0.0375007f, -0.0238314f, 0.038784f, -0.0174034f, 0.0131743f, -0.0506589f, -0.00484469f, -0.0240239f, 0.0325789f, 0.00790064f, 0.0220157f, 0.0333314f}}, {2, {-0.126572f, -0.121882f, 0.121569f, 0.0489971f, -0.240177f, -0.124685f, -0.122565f, 0.0162748f, 0.0317536f, -0.0270355f, 0.0418199f, -0.179755f, -0.327279f, -0.0342741f, 0.133831f, -0.0238279f, 0.122148f, 0.269115f, 0.185989f, 0.525976f, -0.167208f, -0.109612f, 0.0531226f, 0.0695387f, -0.248335f, -0.134123f, -0.108246f, 0.00628498f, 0.0492984f, -0.0264919f, 0.0698144f, -0.0635602f, -0.295363f, -0.0760078f, 0.102725f, -0.0351708f, 0.149804f, 0.259131f, 0.202573f, 0.500664f}}, {3, {-0.0213783f, 0.0350169f, 0.000324794f, 0.0276012f, -0.0263374f, -0.0371449f, 0.0446149f, -0.0205474f, 0.0103729f, -0.0576349f, -0.0150052f, -0.0292043f, 0.0376827f, 0.0136115f, 0.0243435f, 0.0354492f, -0.0204549f, 0.0450315f, -0.00117378f, 0.0167673f, -0.0375007f, -0.0238314f, 0.038784f, -0.0174034f, 0.0131743f, -0.0506589f, -0.0048447f, -0.0240239f, 0.0325789f, 0.00790065f, 0.0220157f, 0.0333314f}}, {0, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}},
+ // int -> INT32 map
+ {},
+ // int -> QUANT8_ASYMM map
+ {}
+}
+}, // End of an example
diff --git a/nn/runtime/test/generated/examples/lstm3_state3.example.cpp b/nn/runtime/test/generated/examples/lstm3_state3.example.cpp
new file mode 100644
index 000000000..0c269a6db
--- /dev/null
+++ b/nn/runtime/test/generated/examples/lstm3_state3.example.cpp
@@ -0,0 +1,22 @@
+// Generated file (from: lstm3_state3.mod.py). Do not edit
+// Begin of an example
+{
+//Input(s)
+{ // See tools/test_generator/include/TestHarness.h:MixedTyped
+ // int -> FLOAT32 map
+ {{0, {0.867394f, 0.291279f, 0.013714f, 0.482521f, 0.626339f, 0.082922f, 0.563329f, 0.865614f, 0.333232f, 0.259916f}}, {1, {0.021393683f, 0.06124551f, 0.046905167f, -0.014657677f, -0.03149463f, 0.09171803f, 0.14647801f, 0.10797193f, -0.0057968358f, 0.0019193048f, -0.2726754f, 0.10154029f, -0.018539885f, 0.080349885f, -0.10262385f, -0.022599787f, -0.09121155f, -0.008675967f, -0.045206103f, -0.0821282f, -0.008045952f, 0.015478081f, 0.055217247f, 0.038719587f, 0.044153627f, -0.06453243f, 0.05031825f, -0.046935108f, -0.008164439f, 0.014574226f, -0.1671009f, -0.15519552f, -0.16819797f, -0.13971269f, -0.11953059f, 0.25005487f, -0.22790983f, 0.009855087f, -0.028140958f, -0.11200698f, 0.11295408f, -0.0035217577f, 0.054485075f, 0.05184695f, 0.064711206f, 0.10989193f, 0.11674786f, 0.03490607f, 0.07727357f, 0.11390585f, -0.1863375f, -0.1034451f, -0.13945189f, -0.049401227f, -0.18767063f, 0.042483903f, 0.14233552f, 0.13832581f, 0.18350165f, 0.14545603f, -0.028545704f, 0.024939531f, 0.050929718f, 0.0076203286f, -0.0029723682f, -0.042484224f, -0.11827596f, -0.09171104f, -0.10808628f, -0.16327988f, -0.2273378f, -0.0993647f, -0.017155107f, 0.0023917493f, 0.049272764f, 0.0038534778f, 0.054764505f, 0.089753784f, 0.06947234f, 0.08014476f, -0.04544234f, -0.0497073f, -0.07135631f, -0.048929106f, -0.004042012f, -0.009284026f, 0.018042054f, 0.0036860977f, -0.07427302f, -0.11434604f, -0.018995456f, 0.031487543f, 0.012834908f, 0.019977754f, 0.044256654f, -0.39292613f, -0.18519334f, -0.11651281f, -0.06809892f, 0.011373677f}}, {2, {-0.0018401089f, -0.004852237f, 0.03698424f, 0.014181704f, 0.028273236f, -0.016726194f, -0.05249759f, -0.10204261f, 0.00861066f, -0.040979505f, -0.009899187f, 0.01923892f, -0.028177269f, -0.08535103f, -0.14585495f, 0.10662567f, -0.01909731f, -0.017883534f, -0.0047269356f, -0.045103323f, 0.0030784295f, 0.076784775f, 0.07463696f, 0.094531395f, 0.0814421f, -0.12257899f, -0.033945758f, -0.031303465f, 0.045630626f, 0.06843887f, -0.13492945f, -0.012480007f, -0.0811829f, -0.07224499f, -0.09628791f, 0.045100946f, 0.0012300825f, 0.013964662f, 0.099372394f, 0.02543059f, 0.06958324f, 0.034257296f, 0.0482646f, 0.06267997f, 0.052625068f, 0.12784666f, 0.07077897f, 0.025725935f, 0.04165009f, 0.07241905f, 0.018668644f, -0.037377294f, -0.06277783f, -0.08833636f, -0.040120605f, -0.011405586f, -0.007808335f, -0.010301386f, -0.005102167f, 0.027717464f, 0.05483423f, 0.11449111f, 0.11289652f, 0.10939839f, 0.13396506f, -0.08402166f, -0.01901462f, -0.044678304f, -0.07720565f, 0.014350063f, -0.11757958f, -0.0652038f, -0.08185733f, -0.076754324f, -0.092614375f, 0.10405491f, 0.052960336f, 0.035755895f, 0.035839386f, -0.012540553f, 0.036881298f, 0.02913376f, 0.03420159f, 0.05448447f, -0.054523353f, 0.02582715f, 0.02327355f, -0.011857179f, -0.0011980024f, -0.034641717f, -0.026125094f, -0.17582615f, -0.15923657f, -0.27486774f, -0.0006143371f, 0.0001771948f, -8.470171e-05f, 0.02651807f, 0.045790765f, 0.06956496f}}, {3, {-0.04580283f, -0.09549462f, -0.032418985f, -0.06454633f, -0.043528453f, 0.043018587f, -0.049152344f, -0.12418144f, -0.078985475f, -0.07596889f, 0.019484362f, -0.11434962f, -0.0074034138f, -0.06314844f, -0.092981495f, 0.0062155537f, -0.025034338f, -0.0028890965f, 0.048929527f, 0.06235075f, 0.10665918f, -0.032036792f, -0.08505916f, -0.10843358f, -0.13002433f, -0.036816437f, -0.02130134f, -0.016518239f, 0.0047691227f, -0.0025825808f, 0.066017866f, 0.029991534f, -0.10652836f, -0.1037554f, -0.13056071f, -0.03266643f, -0.033702414f, -0.006473424f, -0.04611692f, 0.014419339f, -0.025174323f, 0.0396852f, 0.081777506f, 0.06157468f, 0.10210095f, -0.009658194f, 0.046511717f, 0.03603906f, 0.0069369148f, 0.015960095f, -0.06507666f, 0.09551598f, 0.053568836f, 0.06408714f, 0.12835667f, -0.008714329f, -0.20211966f, -0.12093674f, 0.029450472f, 0.2849013f, -0.029227901f, 0.1164364f, -0.08560263f, 0.09941786f, -0.036999565f, -0.028842626f, -0.0033637602f, -0.017012902f, -0.09720865f, -0.11193351f, -0.029155117f, -0.017936034f, -0.009768936f, -0.04223324f, -0.036159635f, 0.06505112f, -0.021742892f, -0.023377212f, -0.07221364f, -0.06430552f, 0.05453865f, 0.091149814f, 0.06387331f, 0.007518393f, 0.055960953f, 0.069779344f, 0.046411168f, 0.10509911f, 0.07463894f, 0.0075130584f, 0.012850982f, 0.04555431f, 0.056955688f, 0.06555285f, 0.050801456f, -0.009862683f, 0.00826772f, -0.026555609f, -0.0073611983f, -0.0014897042f}}, {4, {-0.0998932f, -0.07201956f, -0.052803773f, -0.15629593f, -0.15001918f, -0.07650751f, 0.02359855f, -0.075155355f, -0.08037709f, -0.15093534f, 0.029517552f, -0.04751393f, 0.010350531f, -0.02664851f, -0.016839722f, -0.023121163f, 0.0077019283f, 0.012851257f, -0.05040649f, -0.0129761f, -0.021737747f, -0.038305793f, -0.06870586f, -0.01481247f, -0.001285394f, 0.10124236f, 0.083122835f, 0.053313006f, -0.062235646f, -0.075637154f, -0.027833903f, 0.029774971f, 0.1130802f, 0.09218906f, 0.09506135f, -0.086665764f, -0.037162706f, -0.038880914f, -0.035832845f, -0.014481564f, -0.09825003f, -0.12048569f, -0.097665586f, -0.05287633f, -0.0964047f, -0.11366429f, 0.035777505f, 0.13568819f, 0.052451383f, 0.050649304f, 0.05798951f, -0.021852335f, -0.099848844f, 0.014740475f, -0.078897946f, 0.04974699f, 0.014160473f, 0.06973932f, 0.04964942f, 0.033364646f, 0.08190124f, 0.025535367f, 0.050893165f, 0.048514254f, 0.06945813f, -0.078907564f, -0.06707616f, -0.11844508f, -0.09986688f, -0.07509403f, 0.06263226f, 0.14925587f, 0.20188436f, 0.12098451f, 0.14639415f, 0.0015017595f, -0.014267382f, -0.03417257f, 0.012711468f, 0.0028300495f, -0.024758482f, -0.05098548f, -0.0821182f, 0.014225672f, 0.021544158f, 0.08949725f, 0.07505268f, -0.0020780868f, 0.04908258f, 0.06476295f, -0.022907063f, 0.027562456f, 0.040185735f, 0.019567577f, -0.015598739f, -0.049097303f, -0.017121866f, -0.083368234f, -0.02332002f, -0.0840956f}}, {5, {-0.001374326f, -0.078856036f, 0.10672688f, 0.029162422f, -0.11585556f, 0.02557986f, -0.13446963f, -0.035785314f, -0.01244275f, 0.025961924f, -0.02337298f, -0.044228926f, -0.055839065f, -0.046598054f, -0.010546039f, -0.06900766f, 0.027239809f, 0.022582639f, -0.013296484f, -0.05459212f, 0.08981f, -0.045407712f, 0.08682226f, -0.06867011f, -0.14390695f, -0.02916037f, 0.000996957f, 0.091420636f, 0.14283475f, -0.07390571f, -0.06402044f, 0.062524505f, -0.093129106f, 0.04860203f, -0.08364217f, -0.08119002f, 0.009352075f, 0.22920375f, 0.0016303885f, 0.11583097f, -0.13732095f, 0.012405723f, -0.07551853f, 0.06343048f, 0.12162708f, -0.031923793f, -0.014335606f, 0.01790974f, -0.10650317f, -0.0724401f, 0.08554849f, -0.05727212f, 0.06556731f, -0.042729504f, -0.043227166f, 0.011683251f, -0.013082158f, -0.029302018f, -0.010899579f, -0.062036745f, -0.022509435f, -0.00964907f, -0.01567329f, 0.04260106f, -0.07787477f, -0.11576462f, 0.017356863f, 0.048673786f, -0.017577527f, -0.05527947f, -0.082487635f, -0.040137455f, -0.10820036f, -0.04666372f, 0.022746278f, -0.07851417f, 0.01068115f, 0.032956902f, 0.022433773f, 0.0026891115f, 0.08944216f, -0.0685835f, 0.010513544f, 0.07228705f, 0.02032331f, -0.059686817f, -0.0005566496f, -0.086984694f, 0.040414046f, -0.1380399f, 0.094208956f, -0.05722982f, 0.012092817f, -0.04989123f, -0.086576f, -0.003399834f, -0.04696032f, -0.045747425f, 0.10091314f, 0.048676282f, -0.029037097f, 0.031399418f, -0.0040285117f, 0.047237843f, 0.09504992f, 0.041799378f, -0.049185462f, -0.031518843f, -0.10516937f, 0.026374253f, 0.10058866f, -0.0033195973f, -0.041975245f, 0.0073591834f, 0.0033782164f, -0.004325073f, -0.10167381f, 0.042500053f, -0.01447153f, 0.06464186f, -0.017142897f, 0.03312627f, 0.009205989f, 0.024138335f, -0.011337001f, 0.035530265f, -0.010912711f, 0.0706555f, -0.005894094f, 0.051841937f, -0.1401738f, -0.02351249f, 0.0365468f, 0.07590991f, 0.08838724f, 0.021681072f, -0.10086113f, 0.019608743f, -0.06195883f, 0.077335775f, 0.023646897f, -0.095322326f, 0.02233014f, 0.09756986f, -0.048691444f, -0.009579111f, 0.07595467f, 0.11480546f, -0.09801813f, 0.019894179f, 0.08502348f, 0.004032281f, 0.037211012f, 0.068537936f, -0.048005626f, -0.091520436f, -0.028379958f, -0.01556313f, 0.06554592f, -0.045599163f, -0.01672207f, -0.020169014f, -0.011877351f, -0.20212261f, 0.010889619f, 0.0047078193f, 0.038385306f, 0.08540671f, -0.017140968f, -0.0035865551f, 0.016678626f, 0.005633034f, 0.015963363f, 0.00871737f, 0.060130805f, 0.028611384f, 0.10109069f, -0.015060172f, -0.07894427f, 0.06401885f, 0.011584063f, -0.024466386f, 0.0047652307f, -0.09041358f, 0.030737216f, -0.0046374933f, 0.14215417f, -0.11823516f, 0.019899689f, 0.006106124f, -0.027092824f, 0.0786356f, 0.05052217f, -0.058925f, -0.011402121f, -0.024987547f, -0.0013661642f, -0.06832946f, -0.015667673f, -0.1083353f, -0.00096863037f, -0.06988685f, -0.053350925f, -0.027275559f, -0.033664223f, -0.07978348f, -0.025200296f, -0.017207067f, -0.058403496f, -0.055697463f, 0.005798788f, 0.12965427f, -0.062582195f, 0.0013350133f, -0.10482091f, 0.0379771f, 0.072521195f, -0.0029455067f, -0.13797039f, -0.03628521f, 0.013806405f, -0.017858358f, -0.01008298f, -0.07700066f, -0.017081132f, 0.019358726f, 0.0027079724f, 0.004635139f, 0.062634714f, -0.02338735f, -0.039547626f, -0.02050681f, 0.03385117f, -0.083611414f, 0.002862572f, -0.09421313f, 0.058618143f, -0.08598433f, 0.00972939f, 0.023867095f, -0.053934585f, -0.023203006f, 0.07452513f, -0.048767887f, -0.07314807f, -0.056307215f, -0.10433547f, -0.06440842f, 0.04328182f, 0.04389765f, -0.020006588f, -0.09076438f, -0.11652589f, -0.021705797f, 0.03345259f, -0.010329105f, -0.025767034f, 0.013057034f, -0.07316461f, -0.10145612f, 0.06358255f, 0.18531723f, 0.07759293f, 0.12006465f, 0.1305557f, 0.058638252f, -0.03393652f, 0.09622831f, -0.16253184f, -2.4580743e-06f, 0.079869635f, -0.070196845f, -0.005644518f, 0.06857898f, -0.12598175f, -0.035084512f, 0.03156317f, -0.12794146f, -0.031963028f, 0.04692781f, 0.030070418f, 0.0071660685f, -0.095516115f, -0.004643372f, 0.040170413f, -0.062104587f, -0.0037324072f, 0.0554317f, 0.08184801f, -0.019164372f, 0.06791302f, 0.034257166f, -0.10307039f, 0.021943003f, 0.046745934f, 0.0790918f, -0.0265588f, -0.007824208f, 0.042546265f, -0.00977924f, -0.0002440307f, -0.017384544f, -0.017990116f, 0.12252321f, -0.014512694f, -0.08251313f, 0.08861942f, 0.13589665f, 0.026351685f, 0.012641483f, 0.07466548f, 0.044301085f, -0.045414884f, -0.051112458f, 0.03444247f, -0.08502782f, -0.04106223f, -0.028126027f, 0.028473156f, 0.10467447f}}, {6, {-0.057784554f, -0.026057621f, -0.068447545f, -0.022581743f, 0.14811787f, 0.10826372f, 0.09471067f, 0.03987225f, -0.0039523416f, 0.00030638507f, 0.053185795f, 0.10572994f, 0.08414449f, -0.022036452f, -0.00066928595f, -0.09203576f, 0.032950465f, -0.10985798f, -0.023809856f, 0.0021431844f, -0.02196096f, -0.00326074f, 0.00058621005f, -0.074678116f, -0.06193199f, 0.055729095f, 0.03736828f, 0.020123724f, 0.061878487f, -0.04729229f, 0.034919553f, -0.07585433f, -0.04421272f, -0.044019096f, 0.085488975f, 0.04058006f, -0.06890133f, -0.030951202f, -0.024628663f, -0.07672815f, 0.034293607f, 0.08556707f, -0.05293577f, -0.033561368f, -0.04899627f, 0.0241671f, 0.015736353f, -0.095442444f, -0.029564252f, 0.016493602f, -0.035026584f, 0.022337519f, -0.026871363f, 0.004780428f, 0.0077918363f, -0.03601621f, 0.016435321f, -0.03263031f, -0.09543275f, -0.047392778f, 0.013454138f, 0.028934088f, 0.01685226f, -0.086110644f, -0.046250615f, -0.01847454f, 0.047608484f, 0.07339695f, 0.034546845f, -0.04881143f, 0.009128804f, -0.08802852f, 0.03761666f, 0.008096139f, -0.014454086f, 0.014361001f, -0.023502491f, -0.0011840804f, -0.07607001f, 0.001856849f, -0.06509276f, -0.006021153f, -0.08570962f, -0.1451793f, 0.060212336f, 0.055259194f, 0.06974018f, 0.049454916f, -0.027794661f, -0.08077226f, -0.016179763f, 0.1169753f, 0.17213494f, -0.0056326236f, -0.053934924f, -0.0124349f, -0.11520337f, 0.05409887f, 0.088759385f, 0.0019655675f, 0.0042065294f, 0.03881498f, 0.019844765f, 0.041858196f, -0.05695512f, 0.047233116f, 0.038937137f, -0.06542224f, 0.014429736f, -0.09719407f, 0.13908425f, -0.05379757f, 0.012321099f, 0.082840554f, -0.029899208f, 0.044217527f, 0.059855383f, 0.07711018f, -0.045319796f, 0.0948846f, -0.011724666f, -0.0033288454f, -0.033542685f, -0.04764985f, -0.13873616f, 0.040668588f, 0.034832682f, -0.015319203f, -0.018715994f, 0.046002675f, 0.0599172f, -0.043107376f, 0.0294216f, -0.002314414f, -0.022424703f, 0.0030315618f, 0.0014641669f, 0.0029166266f, -0.11878115f, 0.013738511f, 0.12375372f, -0.0006038222f, 0.029104086f, 0.087442465f, 0.052958444f, 0.07558703f, 0.04817258f, 0.044462286f, -0.015213451f, -0.08783778f, -0.0561384f, -0.003008196f, 0.047060397f, -0.002058388f, 0.03429439f, -0.018839769f, 0.024734668f, 0.024614193f, -0.042046934f, 0.09597743f, -0.0043254104f, 0.04320769f, 0.0064070094f, -0.0019131786f, -0.02558259f, -0.022822596f, -0.023273505f, -0.02464396f, -0.10991725f, -0.006240552f, 0.0074488563f, 0.024044557f, 0.04383914f, -0.046476185f, 0.028658995f, 0.060410924f, 0.050786525f, 0.009452605f, -0.0073054377f, -0.024810238f, 0.0052906186f, 0.0066939713f, -0.0020913032f, 0.014515517f, 0.015898481f, 0.021362653f, -0.030262267f, 0.016587038f, -0.011442813f, 0.041154444f, -0.007631438f, -0.03423484f, -0.010977775f, 0.036152758f, 0.0066366293f, 0.11915515f, 0.02318443f, -0.041350313f, 0.021485701f, -0.10906167f, -0.028218046f, -0.00954771f, 0.020531068f, -0.11995105f, -0.03672871f, 0.024019798f, 0.014255957f, -0.05221243f, -0.00661567f, -0.04630967f, 0.033188973f, 0.10107534f, -0.014027541f, 0.030796422f, -0.10270911f, -0.035999842f, 0.15443139f, 0.07684145f, 0.036571592f, -0.035900835f, -0.0034699554f, 0.06209149f, 0.015920248f, -0.031122351f, -0.03858649f, 0.01849943f, 0.13872518f, 0.01503974f, 0.069941424f, -0.06948533f, -0.0088794185f, 0.061282158f, -0.047401894f, 0.03100163f, -0.041533746f, -0.10430945f, 0.044574402f, -0.01425562f, -0.024290353f, 0.034563623f, 0.05866852f, 0.023947537f, -0.09445152f, 0.035450947f, 0.02247216f, -0.0042998926f, 0.061146557f, -0.10250651f, 0.020881841f, -0.06747029f, 0.10062043f, -0.0023941975f, 0.03532124f, -0.016341697f, 0.09685456f, -0.016764693f, 0.051808182f, 0.05875331f, -0.04536488f, 0.001626336f, -0.028892258f, -0.01048663f, -0.009793449f, -0.017093895f, 0.010987891f, 0.02357273f, -0.00010856845f, 0.0099760275f, -0.001845119f, -0.03551521f, 0.0018358806f, 0.05763657f, -0.01769146f, 0.040995963f, 0.02235177f, -0.060430344f, 0.11475477f, -0.023854522f, 0.10071741f, 0.0686208f, -0.014250481f, 0.034261297f, 0.047418304f, 0.08562733f, -0.030519066f, 0.0060542435f, 0.014653856f, -0.038836084f, 0.04096551f, 0.032249358f, -0.08355519f, -0.026823482f, 0.056386515f, -0.010401743f, -0.028396193f, 0.08507674f, 0.014410365f, 0.020995233f, 0.17040324f, 0.11511526f, 0.02459721f, 0.0066619175f, 0.025853224f, -0.023133837f, -0.081302024f, 0.017264642f, -0.009585969f, 0.09491168f, -0.051313367f, 0.054532815f, -0.014298593f, 0.10657464f, 0.007076659f, 0.10964551f, 0.0409152f, 0.008275321f, -0.07283536f, 0.07937492f, 0.04192024f, -0.1075027f}}, {7, {-0.037322544f, 0.018592842f, 0.0056175636f, -0.06253426f, 0.055647098f, -0.05713207f, -0.05626563f, 0.005559383f, 0.03375411f, -0.025757805f, -0.088049285f, 0.06017052f, -0.06570978f, 0.007384076f, 0.035123326f, -0.07920549f, 0.053676967f, 0.044480428f, -0.07663568f, 0.0071805613f, 0.08089997f, 0.05143358f, 0.038261272f, 0.03339287f, -0.027673481f, 0.044746667f, 0.028349208f, 0.020090483f, -0.019443132f, -0.030755889f, -0.0040000007f, 0.04465846f, -0.021585021f, 0.0031670958f, 0.0053199246f, -0.056117613f, -0.10893326f, 0.076739706f, -0.08509834f, -0.027997585f, 0.037871376f, 0.01449768f, -0.09002357f, -0.06111149f, -0.046195522f, 0.0422062f, -0.005683705f, -0.1253618f, -0.012925729f, -0.04890792f, 0.06985068f, 0.037654128f, 0.03398274f, -0.004781977f, 0.007032333f, -0.031787455f, 0.010868644f, -0.031489216f, 0.09525667f, 0.013939797f, 0.0058680447f, 0.0167067f, 0.02668468f, -0.04797466f, -0.048885044f, -0.12722108f, 0.035304096f, 0.06554885f, 0.00972396f, -0.039238118f, -0.05159735f, -0.11329045f, 0.1613692f, -0.03750952f, 0.06529313f, -0.071974665f, -0.11769596f, 0.015524369f, -0.0013754242f, -0.12446318f, 0.02786344f, -0.014179351f, 0.005264273f, 0.14376344f, 0.015983658f, 0.03406988f, -0.06939408f, 0.040699873f, 0.02111075f, 0.09669095f, 0.041345075f, -0.08316494f, -0.07684199f, -0.045768797f, 0.032298047f, -0.041805092f, 0.0119405f, 0.0061010392f, 0.12652606f, 0.0064572375f, -0.024950314f, 0.11574242f, 0.04508852f, -0.04335324f, 0.06760663f, -0.027437469f, 0.07216407f, 0.06977076f, -0.05438599f, 0.034033038f, -0.028602652f, 0.05346137f, 0.043184172f, -0.037189785f, 0.10420091f, 0.00882477f, -0.054019816f, -0.074273005f, -0.030617684f, -0.0028467078f, 0.024302477f, -0.0038869337f, 0.005332455f, 0.0013399826f, 0.04361412f, -0.007001822f, 0.09631092f, -0.06702025f, -0.042049985f, -0.035070654f, -0.04103342f, -0.10273396f, 0.0544271f, 0.037184782f, -0.13150354f, -0.0058036847f, -0.008264958f, 0.042035464f, 0.05891794f, 0.029673764f, 0.0063542654f, 0.044788733f, 0.054816857f, 0.062257513f, -0.00093483756f, 0.048938446f, -0.004952862f, -0.007730018f, -0.04043371f, -0.017094059f, 0.07229206f, -0.023670016f, -0.052195564f, -0.025616996f, -0.01520939f, 0.045104615f, -0.007376126f, 0.003533447f, 0.006570588f, 0.056037236f, 0.12436656f, 0.051817212f, 0.028532185f, -0.08686856f, 0.11868599f, 0.07663395f, -0.07323171f, 0.03463402f, -0.050708205f, -0.04458982f, -0.11590894f, 0.021273347f, 0.1251325f, -0.15313013f, -0.12224372f, 0.17228661f, 0.023029093f, 0.086124025f, 0.006445803f, -0.03496501f, 0.028332196f, 0.04449512f, -0.042436164f, -0.026587414f, -0.006041347f, -0.09292539f, -0.05678812f, 0.03897832f, 0.09465633f, 0.008115513f, -0.02171956f, 0.08304309f, 0.071401566f, 0.019622514f, 0.032163795f, -0.004167056f, 0.02295182f, 0.030739572f, 0.056506045f, 0.004612461f, 0.06524936f, 0.059999723f, 0.046395954f, -0.0045512207f, -0.1335546f, -0.030136576f, 0.11584653f, -0.014678886f, 0.0020118146f, -0.09688814f, -0.0790206f, 0.039770417f, -0.0329582f, 0.07922767f, 0.029322514f, 0.026405897f, 0.04207835f, -0.07073373f, 0.063781224f, 0.0859677f, -0.10925287f, -0.07011058f, 0.048005477f, 0.03438226f, -0.09606514f, -0.006669445f, -0.043381985f, 0.04240257f, -0.06955775f, -0.06769346f, 0.043903265f, -0.026784198f, -0.017840602f, 0.024307009f, -0.040079936f, -0.019946516f, 0.045318738f, -0.12233574f, 0.026170589f, 0.0074471775f, 0.15978073f, 0.10185836f, 0.10298046f, -0.015476589f, -0.039390966f, -0.072174534f, 0.0739445f, -0.1211869f, -0.0347889f, -0.07943156f, 0.014809798f, -0.12412325f, -0.0030663363f, 0.039695457f, 0.0647603f, -0.08291318f, -0.018529687f, -0.004423833f, 0.0037507233f, 0.084633216f, -0.01514876f, -0.056505352f, -0.012800942f, -0.06994386f, 0.012962922f, -0.031234352f, 0.07029052f, 0.016418684f, 0.03618972f, 0.055686004f, -0.08663945f, -0.017404709f, -0.054761406f, 0.029065743f, 0.052404847f, 0.020238016f, 0.0048197987f, -0.0214882f, 0.07078733f, 0.013016777f, 0.06262858f, 0.009184685f, 0.020785125f, -0.043904778f, -0.0270329f, -0.03299152f, -0.060088247f, -0.015162964f, -0.001828936f, 0.12642565f, -0.056757294f, 0.013586685f, 0.09232601f, -0.035886683f, 0.06000002f, 0.05229691f, -0.052580316f, -0.082029596f, -0.010794592f, 0.012947712f, -0.036429964f, -0.085508935f, -0.13127148f, -0.017744139f, 0.031502828f, 0.036232427f, -0.031581745f, 0.023051167f, -0.05325106f, -0.03421577f, 0.028793324f, -0.034633752f, -0.009881397f, -0.043551125f, -0.018609839f, 0.0019097115f, -0.008799762f, 0.056595087f, 0.0022273948f, 0.055752404f}}, {8, {0.025825322f, -0.05813119f, 0.09495884f, -0.045984812f, -0.01255415f, -0.0026479573f, -0.08196161f, -0.054914974f, -0.0046604523f, -0.029587349f, -0.044576716f, -0.07480124f, -0.082868785f, 0.023254942f, 0.027502948f, -0.0039728214f, -0.08683098f, -0.08116779f, -0.014675607f, -0.037924774f, -0.023314456f, -0.007401714f, -0.09255757f, 0.029460307f, -0.08829125f, -0.005139627f, -0.08989442f, -0.0555066f, 0.13596267f, -0.025062224f, -0.048351806f, -0.03850004f, 0.07266485f, -0.022414139f, 0.05940088f, 0.075114764f, 0.09597592f, -0.010211725f, -0.0049794707f, -0.011523867f, -0.025980417f, 0.072999895f, 0.11091378f, -0.081685916f, 0.014416728f, 0.043229222f, 0.034178585f, -0.07530371f, 0.035837382f, -0.085607f, -0.007721233f, -0.03287832f, -0.043848954f, -0.06404588f, -0.06632928f, -0.073643476f, 0.008214239f, -0.045984086f, 0.039764922f, 0.03474462f, 0.060612556f, -0.080590084f, 0.049127717f, 0.04151091f, -0.030063879f, 0.008801774f, -0.023021035f, -0.019558564f, 0.05158114f, -0.010947698f, -0.011825728f, 0.0075720972f, 0.0699727f, -0.0039981045f, 0.069350146f, 0.08799282f, 0.016156472f, 0.035502106f, 0.11695009f, 0.006217345f, 0.13392477f, -0.037875112f, 0.025745004f, 0.08940699f, -0.00924166f, 0.0046702605f, -0.036598757f, -0.08811812f, 0.10522024f, -0.032441203f, 0.008176899f, -0.04454919f, 0.07058152f, 0.0067963637f, 0.039206743f, 0.03259838f, 0.03725492f, -0.09515802f, 0.013326398f, -0.052055415f, -0.025676316f, 0.03198509f, -0.015951829f, -0.058556724f, 0.036879618f, 0.043357447f, 0.028362012f, -0.05908629f, 0.0059240665f, -0.04995891f, -0.019187413f, 0.0276265f, -0.01628143f, 0.0025863599f, 0.08800015f, 0.035250366f, -0.022165963f, -0.07328642f, -0.009415526f, -0.07455109f, 0.11690406f, 0.0363299f, 0.07411125f, 0.042103454f, -0.009660886f, 0.019076364f, 0.018299393f, -0.046004917f, 0.08891175f, 0.0431396f, -0.026327137f, -0.051502608f, 0.08979574f, -0.051670972f, 0.04940282f, -0.07491107f, -0.021240504f, 0.022596184f, -0.034280192f, 0.060163025f, -0.058211457f, -0.051837247f, -0.01349775f, -0.04639988f, -0.035936575f, -0.011681591f, 0.064818054f, 0.0073146066f, -0.021745546f, -0.043124277f, -0.06471268f, -0.07053354f, -0.029321948f, -0.05330136f, 0.016933719f, -0.053782392f, 0.13747959f, -0.1361751f, -0.11569455f, 0.0033329215f, 0.05693899f, -0.053219706f, 0.063698f, 0.07977434f, -0.07924483f, 0.06936997f, 0.0034815092f, -0.007305279f, -0.037325785f, -0.07251102f, -0.033633437f, -0.08677009f, 0.091591336f, -0.14165086f, 0.021752775f, 0.019683983f, 0.0011612234f, -0.058154266f, 0.049996935f, 0.0288841f, -0.0024567875f, -0.14345716f, 0.010955264f, -0.10234828f, 0.1183656f, -0.0010731248f, -0.023590032f, -0.072285876f, -0.0724771f, -0.026382286f, -0.0014920527f, 0.042667855f, 0.0018776858f, 0.02986552f, 0.009814309f, 0.0733756f, 0.12289186f, 0.018043943f, -0.0458958f, 0.049412545f, 0.033632483f, 0.05495232f, 0.036686596f, -0.013781798f, -0.010036754f, 0.02576849f, -0.08307328f, 0.010112348f, 0.042521734f, -0.05869831f, -0.071689695f, 0.03876447f, -0.13275425f, -0.0352966f, -0.023077697f, 0.10285965f, 0.084736146f, 0.15568255f, -0.00040734606f, 0.027835453f, -0.10292561f, -0.032401145f, 0.10053256f, -0.026142767f, -0.08271222f, -0.0030240538f, -0.016368777f, 0.1070414f, 0.042672627f, 0.013456989f, -0.0437609f, -0.022309763f, 0.11576483f, 0.04108048f, 0.061026827f, -0.0190714f, -0.0869359f, 0.037901703f, 0.0610107f, 0.07202949f, 0.01675338f, 0.086139716f, -0.08795751f, -0.014898893f, -0.023771819f, -0.01965048f, 0.007955471f, -0.043740474f, 0.03346837f, -0.10549954f, 0.090567775f, 0.042013682f, -0.03176985f, 0.12569028f, -0.02421228f, -0.029526481f, 0.023851605f, 0.031539805f, 0.05292009f, -0.02344001f, -0.07811758f, -0.08834428f, 0.10094801f, 0.16594367f, -0.06861939f, -0.021256343f, -0.041093912f, -0.06669611f, 0.035498552f, 0.021757556f, -0.09302526f, -0.015403468f, -0.06614931f, -0.051798206f, -0.013874718f, 0.03630673f, 0.010412845f, -0.08077351f, 0.046185967f, 0.0035662893f, 0.03541868f, -0.094149634f, -0.034814864f, 0.003128424f, -0.020674974f, -0.03944324f, -0.008110165f, -0.11113267f, 0.08484226f, 0.043586485f, 0.040582247f, 0.0968012f, -0.065249965f, -0.028036479f, 0.0050708856f, 0.0017462453f, 0.0326779f, 0.041296225f, 0.09164146f, -0.047743853f, -0.015952192f, -0.034451712f, 0.084197424f, -0.05347844f, -0.11768019f, 0.085926116f, -0.08251791f, -0.045081906f, 0.0948852f, 0.068401024f, 0.024856757f, 0.06978981f, -0.057309967f, -0.012775832f, -0.0032452994f, 0.01977615f, -0.041040014f, -0.024264973f, 0.063464895f, 0.05431621f}}, {9, {0.040369894f, 0.030746894f, 0.24704495f, 0.018586371f, -0.037586458f, -0.15312155f, -0.11812848f, -0.11465643f, 0.20259799f, 0.11418174f, -0.10116027f, -0.011334949f, 0.12411352f, -0.076769054f, -0.052169047f, 0.21198851f, -0.38871562f, -0.09061183f, -0.09683246f, -0.21929175f}}, {10, {-0.01998659f, -0.15568835f, -0.24248174f, -0.012770197f, 0.041331276f, -0.072311886f, -0.052123554f, -0.0066330447f, -0.043891653f, 0.036225766f, -0.047248036f, 0.021479502f, 0.033189066f, 0.11952997f, -0.020432774f, 0.64658105f, -0.06650122f, -0.03467612f, 0.095340036f, 0.23647355f}}, {11, {0.08286371f, -0.08261836f, -0.51210177f, 0.002913762f, 0.17764764f, -0.5495371f, -0.08460716f, -0.24552552f, 0.030037103f, 0.04123544f, -0.11940523f, 0.007358328f, 0.1890978f, 0.4833202f, -0.34441817f, 0.36312827f, -0.26375428f, 0.1457655f, -0.19724406f, 0.15548733f}}, {12, {0.02234832f, 0.14757581f, 0.18176508f, 0.10380666f, 0.053110216f, -0.06928846f, -0.13942584f, -0.11816189f, 0.19483899f, 0.03652339f, -0.10250295f, 0.036714908f, -0.18426876f, 0.036065217f, 0.21810818f, 0.02383196f, -0.043370757f, 0.08690144f, -0.04444982f, 0.00030581196f}}, {13, {0.035185695f, -0.042891346f, -0.03032477f, 0.23027696f, 0.11098921f, 0.15378423f, 0.09263801f, 0.09790885f, 0.09508917f, 0.061199076f, 0.07665568f, -0.015443159f, -0.03499149f, 0.046190713f, 0.08895977f, 0.10899629f, 0.40694186f, 0.06030037f, 0.012413437f, -0.06108739f}}, {14, {-0.024379363f, 0.0055531194f, 0.23377132f, 0.033463873f, -0.1483596f, -0.10639995f, -0.091433935f, 0.058573797f, -0.06809782f, -0.07889636f, -0.043246906f, -0.09829136f, -0.4279842f, 0.034901652f, 0.18797937f, 0.0075234566f, 0.016178843f, 0.1749513f, 0.13975595f, 0.92058027f}}, {15, {0.046159424f, -0.0012809046f, 0.03563469f, 0.12648113f, 0.027195795f, 0.35373217f, -0.018957434f, 0.008907322f, -0.0762701f, 0.12018895f, 0.04216877f, 0.0022856654f, 0.040952638f, 0.3147856f, 0.08225149f, -0.057416286f, -0.14995944f, -0.008040261f, 0.13208859f, 0.029760877f}}, {16, {-0.009802181f, 0.09401916f, 0.0717386f, -0.13895074f, 0.09641832f, 0.060420845f, 0.08539281f, 0.054285463f, 0.061395317f, 0.034448683f, -0.042991187f, 0.019801661f, -0.16840284f, -0.015726732f, -0.23041931f, -0.024478018f, -0.10959692f, -0.013875541f, 0.18600968f, -0.061274476f, 0.0138165f, -0.08160894f, -0.07661644f, 0.032372914f, 0.16169067f, 0.22465782f, -0.03993472f, -0.004017731f, 0.08633481f, -0.28869787f, 0.08682067f, 0.17240396f, 0.014975425f, 0.056431185f, 0.031037588f, 0.16702051f, 0.0077946745f, 0.15140012f, 0.29405436f, 0.120285f, -0.188994f, -0.027265169f, 0.043389652f, -0.022061434f, 0.014777949f, -0.20203483f, 0.094781205f, 0.19100232f, 0.13987629f, -0.036132768f, -0.06426278f, -0.05108664f, 0.13221376f, 0.009441198f, -0.16715929f, 0.15859416f, -0.040437475f, 0.050779544f, -0.022187516f, 0.012166504f, 0.027685808f, -0.07675938f, -0.0055694645f, -0.09444123f, 0.0046453946f, 0.050794356f, 0.10770313f, -0.20790008f, -0.07149004f, -0.11425117f, 0.008225835f, -0.035802525f, 0.14374903f, 0.15262283f, 0.048710253f, 0.1847461f, -0.007487823f, 0.11000021f, -0.09542012f, 0.22619456f, -0.029149994f, 0.08527916f, 0.009043713f, 0.0042746216f, 0.016261552f, 0.022461696f, 0.12689082f, -0.043589946f, -0.12035478f, -0.08361797f, -0.050666027f, -0.1248618f, -0.1275799f, -0.071875185f, 0.07377272f, 0.09944291f, -0.18897448f, -0.1593054f, -0.06526116f, -0.040107165f, -0.004618631f, -0.067624845f, -0.007576253f, 0.10727444f, 0.041546922f, -0.20424393f, 0.06907816f, 0.050412357f, 0.00724631f, 0.039827548f, 0.12449835f, 0.10747581f, 0.13708383f, 0.09134148f, -0.12617786f, -0.06428341f, 0.09956831f, 0.1208086f, -0.14676677f, -0.0727722f, 0.1126304f, 0.010139365f, 0.015571211f, -0.038128063f, 0.022913318f, -0.042050496f, 0.16842307f, -0.060597885f, 0.10531834f, -0.06411776f, -0.07451711f, -0.03410368f, -0.13393489f, 0.06534304f, 0.003620307f, 0.04490757f, 0.05970546f, 0.05197996f, 0.02839995f, 0.10434969f, -0.013699693f, -0.028353551f, -0.07260381f, 0.047201227f, -0.024575593f, -0.036445823f, 0.07155557f, 0.009672501f, -0.02328883f, 0.009533515f, -0.03606021f, -0.07421458f, -0.028082801f, -0.2678904f, -0.13221288f, 0.18419984f, -0.13012612f, -0.014588381f, -0.035059117f, -0.04824723f, 0.07830115f, -0.056184657f, 0.03277091f, 0.025466874f, 0.14494097f, -0.12522776f, -0.098633975f, -0.10766018f, -0.08317623f, 0.08594209f, 0.07749552f, 0.039474737f, 0.1776665f, -0.07409566f, -0.0477268f, 0.29323658f, 0.10801441f, 0.1154011f, 0.013952499f, 0.10739139f, 0.10708251f, -0.051456142f, 0.0074137426f, -0.10430189f, 0.10034707f, 0.045594677f, 0.0635285f, -0.0715442f, -0.089667566f, -0.10811871f, 0.00026344223f, 0.08298446f, -0.009525053f, 0.006585689f, -0.24567553f, -0.09450807f, 0.09648481f, 0.026996298f, -0.06419476f, -0.04752702f, -0.11063944f, -0.23441927f, -0.17608605f, -0.052156363f, 0.067035615f, 0.19271925f, -0.0032889997f, -0.043264326f, 0.09663576f, -0.057112187f, -0.10100678f, 0.0628376f, 0.04447668f, 0.017961001f, -0.10094388f, -0.10190601f, 0.18335468f, 0.10494553f, -0.052095775f, -0.0026118709f, 0.10539724f, -0.04383912f, -0.042349473f, 0.08438151f, -0.1947263f, 0.02251204f, 0.11216432f, -0.10307853f, 0.17351969f, -0.039091777f, 0.08066188f, -0.00561982f, 0.12633002f, 0.11335965f, -0.0088127935f, -0.019777594f, 0.06864014f, -0.059751723f, 0.016233567f, -0.06894641f, -0.28651384f, -0.004228674f, 0.019708522f, -0.16305895f, -0.07468996f, -0.0855457f, 0.099339016f, -0.07580735f, -0.13775392f, 0.08434318f, 0.08330512f, -0.12131499f, 0.031935584f, 0.09180414f, -0.08876437f, -0.08049874f, 0.008753825f, 0.03498998f, 0.030215185f, 0.03907079f, 0.089751154f, 0.029194152f, -0.03337423f, -0.019092513f, 0.04331237f, 0.04299654f, -0.036394123f, -0.12915532f, 0.09793732f, 0.07512415f, -0.11319543f, -0.032502122f, 0.15661901f, 0.07671967f, -0.005491124f, -0.19379048f, -0.218606f, 0.21448623f, 0.017840758f, 0.1416943f, -0.07051762f, 0.19488361f, 0.02664691f, -0.18104725f, -0.09334311f, 0.15026465f, -0.15493552f, -0.057762887f, -0.11604192f, -0.262013f, -0.01391798f, 0.012185008f, 0.11156489f, -0.07483202f, 0.06693364f, -0.26151478f, 0.046425626f, 0.036540434f, -0.16435726f, 0.17338543f, -0.21401681f, -0.11385144f, -0.08283257f, -0.069031075f, 0.030635102f, 0.010969227f, 0.11109743f, 0.010919218f, 0.027526086f, 0.13519906f, 0.01891392f, -0.046839405f, -0.040167913f, 0.017953383f, -0.09700955f, 0.0061885654f, -0.07000971f, 0.026893595f, -0.038844477f, 0.14543656f}}, {17, {}}, {18, {-0.0213783f, 0.0350169f, 0.000324787f, 0.0276012f, -0.0263374f, -0.0371449f, 0.0446149f, -0.0205474f, 0.0103729f, -0.0576349f, -0.0150052f, -0.0292043f, 0.0376827f, 0.0136115f, 0.0243435f, 0.0354492f, -0.0204549f, 0.0450315f, -0.00117379f, 0.0167673f, -0.0375007f, -0.0238314f, 0.038784f, -0.0174034f, 0.0131743f, -0.0506589f, -0.00484469f, -0.0240239f, 0.0325789f, 0.00790064f, 0.0220157f, 0.0333314f}}, {19, {-0.126572f, -0.121882f, 0.121569f, 0.0489971f, -0.240177f, -0.124685f, -0.122565f, 0.0162748f, 0.0317536f, -0.0270355f, 0.0418199f, -0.179755f, -0.327279f, -0.0342741f, 0.133831f, -0.0238279f, 0.122148f, 0.269115f, 0.185989f, 0.525976f, -0.167208f, -0.109612f, 0.0531226f, 0.0695387f, -0.248335f, -0.134123f, -0.108246f, 0.00628498f, 0.0492984f, -0.0264919f, 0.0698144f, -0.0635602f, -0.295363f, -0.0760078f, 0.102725f, -0.0351708f, 0.149804f, 0.259131f, 0.202573f, 0.500664f}}, {21, {0.0f}}, {22, {0.0f}}},
+ // int -> INT32 map
+ {{20, {4}}},
+ // int -> QUANT8_ASYMM map
+ {}
+},
+//Output(s)
+{ // See tools/test_generator/include/TestHarness.h:MixedTyped
+ // int -> FLOAT32 map
+ {{1, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}, {2, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}, {3, {-0.0189322f, 0.0464512f, -0.00251373f, 0.0225745f, -0.0308346f, -0.0317124f, 0.0460407f, -0.0189395f, 0.0149363f, -0.0530162f, -0.0150767f, -0.0340193f, 0.0286833f, 0.00824207f, 0.0264887f, 0.0305169f, -0.0264787f, 0.0387855f, -0.000764675f, 0.0217599f, -0.037537f, -0.0335206f, 0.0431679f, -0.0211424f, 0.010203f, -0.062785f, -0.00832363f, -0.025181f, 0.0412031f, 0.0118723f, 0.0239643f, 0.0394009f}}, {0, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}},
+ // int -> INT32 map
+ {},
+ // int -> QUANT8_ASYMM map
+ {}
+}
+}, // End of an example
diff --git a/nn/runtime/test/generated/examples/lstm_state.example.cpp b/nn/runtime/test/generated/examples/lstm_state.example.cpp
new file mode 100644
index 000000000..2a8c9c449
--- /dev/null
+++ b/nn/runtime/test/generated/examples/lstm_state.example.cpp
@@ -0,0 +1,22 @@
+// Generated file (from: lstm_state.mod.py). Do not edit
+// Begin of an example
+{
+//Input(s)
+{ // See tools/test_generator/include/TestHarness.h:MixedTyped
+ // int -> FLOAT32 map
+ {{0, {3.0f, 4.0f}}, {1, {-0.45018822f, -0.02338299f, -0.0870589f, -0.34550029f, 0.04266912f, -0.15680569f, -0.34856534f, 0.43890524f}}, {2, {0.09701663f, 0.20334584f, -0.50592935f, -0.31343272f, -0.40032279f, 0.44781327f, 0.01387155f, -0.35593212f}}, {3, {-0.50013041f, 0.1370284f, 0.11810488f, 0.2013163f, -0.20583314f, 0.44344562f, 0.22077113f, -0.29909778f}}, {4, {-0.25065863f, -0.28290087f, 0.04613829f, 0.40525138f, 0.44272184f, 0.03897077f, -0.1556896f, 0.19487578f}}, {5, {-0.0063535f, -0.2042388f, 0.31454784f, -0.35746509f, 0.28902304f, 0.08183324f, -0.16555229f, 0.02286911f, -0.13566875f, 0.03034258f, 0.48091322f, -0.12528998f, 0.24077177f, -0.51332325f, -0.33502164f, 0.10629296f}}, {6, {-0.48684245f, -0.06655136f, 0.42224967f, 0.2112639f, 0.27654213f, 0.20864892f, -0.07646349f, 0.45877004f, 0.00141793f, -0.14609534f, 0.36447752f, 0.09196436f, 0.28053468f, 0.01560611f, -0.20127171f, -0.01140004f}}, {7, {-0.3407414f, 0.24443203f, -0.2078532f, 0.26320225f, 0.05695659f, -0.00123841f, -0.4744786f, -0.35869038f, -0.06418842f, -0.13502428f, -0.501764f, 0.22830659f, -0.46367589f, 0.26016325f, -0.03894562f, -0.16368064f}}, {8, {0.43385774f, -0.17194885f, 0.2718237f, 0.09215671f, 0.24107647f, -0.39835793f, 0.18212086f, 0.01301402f, 0.48572797f, -0.50656658f, 0.20047462f, -0.20607421f, -0.51818722f, -0.15390486f, 0.0468148f, 0.39922136f}}, {9, {}}, {10, {}}, {11, {}}, {12, {0.0f, 0.0f, 0.0f, 0.0f}}, {13, {1.0f, 1.0f, 1.0f, 1.0f}}, {14, {0.0f, 0.0f, 0.0f, 0.0f}}, {15, {0.0f, 0.0f, 0.0f, 0.0f}}, {16, {}}, {17, {}}, {18, {-0.0297319f, 0.122947f, 0.208851f, -0.153588f}}, {19, {-0.145439f, 0.157475f, 0.293663f, -0.277353f}}, {21, {0.0f}}, {22, {0.0f}}},
+ // int -> INT32 map
+ {{20, {4}}},
+ // int -> QUANT8_ASYMM map
+ {}
+},
+//Output(s)
+{ // See tools/test_generator/include/TestHarness.h:MixedTyped
+ // int -> FLOAT32 map
+ {{1, {-0.0371611f, 0.125073f, 0.411934f, -0.208605f}}, {2, {-0.287121f, 0.148115f, 0.556837f, -0.388276f}}, {3, {-0.03716109f, 0.12507336f, 0.41193449f, -0.20860538f}}, {0, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}},
+ // int -> INT32 map
+ {},
+ // int -> QUANT8_ASYMM map
+ {}
+}
+}, // End of an example
diff --git a/nn/runtime/test/generated/examples/lstm_state2.example.cpp b/nn/runtime/test/generated/examples/lstm_state2.example.cpp
new file mode 100644
index 000000000..c67c7d537
--- /dev/null
+++ b/nn/runtime/test/generated/examples/lstm_state2.example.cpp
@@ -0,0 +1,22 @@
+// Generated file (from: lstm_state2.mod.py). Do not edit
+// Begin of an example
+{
+//Input(s)
+{ // See tools/test_generator/include/TestHarness.h:MixedTyped
+ // int -> FLOAT32 map
+ {{0, {1.0f, 1.0f}}, {1, {-0.45018822f, -0.02338299f, -0.0870589f, -0.34550029f, 0.04266912f, -0.15680569f, -0.34856534f, 0.43890524f}}, {2, {0.09701663f, 0.20334584f, -0.50592935f, -0.31343272f, -0.40032279f, 0.44781327f, 0.01387155f, -0.35593212f}}, {3, {-0.50013041f, 0.1370284f, 0.11810488f, 0.2013163f, -0.20583314f, 0.44344562f, 0.22077113f, -0.29909778f}}, {4, {-0.25065863f, -0.28290087f, 0.04613829f, 0.40525138f, 0.44272184f, 0.03897077f, -0.1556896f, 0.19487578f}}, {5, {-0.0063535f, -0.2042388f, 0.31454784f, -0.35746509f, 0.28902304f, 0.08183324f, -0.16555229f, 0.02286911f, -0.13566875f, 0.03034258f, 0.48091322f, -0.12528998f, 0.24077177f, -0.51332325f, -0.33502164f, 0.10629296f}}, {6, {-0.48684245f, -0.06655136f, 0.42224967f, 0.2112639f, 0.27654213f, 0.20864892f, -0.07646349f, 0.45877004f, 0.00141793f, -0.14609534f, 0.36447752f, 0.09196436f, 0.28053468f, 0.01560611f, -0.20127171f, -0.01140004f}}, {7, {-0.3407414f, 0.24443203f, -0.2078532f, 0.26320225f, 0.05695659f, -0.00123841f, -0.4744786f, -0.35869038f, -0.06418842f, -0.13502428f, -0.501764f, 0.22830659f, -0.46367589f, 0.26016325f, -0.03894562f, -0.16368064f}}, {8, {0.43385774f, -0.17194885f, 0.2718237f, 0.09215671f, 0.24107647f, -0.39835793f, 0.18212086f, 0.01301402f, 0.48572797f, -0.50656658f, 0.20047462f, -0.20607421f, -0.51818722f, -0.15390486f, 0.0468148f, 0.39922136f}}, {9, {}}, {10, {}}, {11, {}}, {12, {0.0f, 0.0f, 0.0f, 0.0f}}, {13, {1.0f, 1.0f, 1.0f, 1.0f}}, {14, {0.0f, 0.0f, 0.0f, 0.0f}}, {15, {0.0f, 0.0f, 0.0f, 0.0f}}, {16, {}}, {17, {}}, {18, {-0.0371611f, 0.125073f, 0.411934f, -0.208605f}}, {19, {-0.287121f, 0.148115f, 0.556837f, -0.388276f}}, {21, {0.0f}}, {22, {0.0f}}},
+ // int -> INT32 map
+ {{20, {4}}},
+ // int -> QUANT8_ASYMM map
+ {}
+},
+//Output(s)
+{ // See tools/test_generator/include/TestHarness.h:MixedTyped
+ // int -> FLOAT32 map
+ {{1, {0, 0, 0, 0}}, {2, {0, 0, 0, 0}}, {3, {-0.15053082f, 0.09120187f, 0.24278517f, -0.12222792f}}, {0, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}},
+ // int -> INT32 map
+ {},
+ // int -> QUANT8_ASYMM map
+ {}
+}
+}, // End of an example
diff --git a/nn/runtime/test/generated/examples/rnn_state.example.cpp b/nn/runtime/test/generated/examples/rnn_state.example.cpp
new file mode 100644
index 000000000..d62b30e98
--- /dev/null
+++ b/nn/runtime/test/generated/examples/rnn_state.example.cpp
@@ -0,0 +1,22 @@
+// Generated file (from: rnn_state.mod.py). Do not edit
+// Begin of an example
+{
+//Input(s)
+{ // See tools/test_generator/include/TestHarness.h:MixedTyped
+ // int -> FLOAT32 map
+ {{0, {-0.69424844f, -0.93421471f, -0.87287879f, 0.37144363f, -0.62476718f, 0.23791671f, 0.40060222f, 0.1356622f, -0.69424844f, -0.93421471f, -0.87287879f, 0.37144363f, -0.62476718f, 0.23791671f, 0.40060222f, 0.1356622f}}, {1, {0.461459f, 0.153381f, 0.529743f, -0.00371218f, 0.676267f, -0.211346f, 0.317493f, 0.969689f, -0.343251f, 0.186423f, 0.398151f, 0.152399f, 0.448504f, 0.317662f, 0.523556f, -0.323514f, 0.480877f, 0.333113f, -0.757714f, -0.674487f, -0.643585f, 0.217766f, -0.0251462f, 0.79512f, -0.595574f, -0.422444f, 0.371572f, -0.452178f, -0.556069f, -0.482188f, -0.685456f, -0.727851f, 0.841829f, 0.551535f, -0.232336f, 0.729158f, -0.00294906f, -0.69754f, 0.766073f, -0.178424f, 0.369513f, -0.423241f, 0.548547f, -0.0152023f, -0.757482f, -0.85491f, 0.251331f, -0.989183f, 0.306261f, -0.340716f, 0.886103f, -0.0726757f, -0.723523f, -0.784303f, 0.0354295f, 0.566564f, -0.485469f, -0.620498f, 0.832546f, 0.697884f, -0.279115f, 0.294415f, -0.584313f, 0.548772f, 0.0648819f, 0.968726f, 0.723834f, -0.0080452f, -0.350386f, -0.272803f, 0.115121f, -0.412644f, -0.824713f, -0.992843f, -0.592904f, -0.417893f, 0.863791f, -0.423461f, -0.147601f, -0.770664f, -0.479006f, 0.654782f, 0.587314f, -0.639158f, 0.816969f, -0.337228f, 0.659878f, 0.73107f, 0.754768f, -0.337042f, 0.0960841f, 0.368357f, 0.244191f, -0.817703f, -0.211223f, 0.442012f, 0.37225f, -0.623598f, -0.405423f, 0.455101f, 0.673656f, -0.145345f, -0.511346f, -0.901675f, -0.81252f, -0.127006f, 0.809865f, -0.721884f, 0.636255f, 0.868989f, -0.347973f, -0.10179f, -0.777449f, 0.917274f, 0.819286f, 0.206218f, -0.00785118f, 0.167141f, 0.45872f, 0.972934f, -0.276798f, 0.837861f, 0.747958f, -0.0151566f, -0.330057f, -0.469077f, 0.277308f, 0.415818f}}, {2, {0.1f, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.1f, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.1f, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.1f, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.1f, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.1f, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.1f, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.1f, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.1f, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.1f, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.1f, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.1f, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.1f, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.1f, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.1f, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.1f}}, {3, {0.065691948f, -0.69055247f, 0.1107955f, -0.97084129f, -0.23957068f, -0.23566568f, -0.389184f, 0.47481549f, -0.4791103f, 0.29931796f, 0.10463274f, 0.83918178f, 0.37197268f, 0.61957061f, 0.3956964f, -0.37609905f}}, {4, {0.496726f, 0, 0.965996f, 0, 0.0584256f, 0, 0, 0.12315f, 0, 0, 0.612267f, 0.456601f, 0, 0.52286f, 1.16099f, 0.0291233f, 0.496726f, 0, 0.965996f, 0, 0.0584256f, 0, 0, 0.12315f, 0, 0, 0.612267f, 0.456601f, 0, 0.52286f, 1.16099f, 0.0291233f}}},
+ // int -> INT32 map
+ {{5, {1}}},
+ // int -> QUANT8_ASYMM map
+ {}
+},
+//Output(s)
+{ // See tools/test_generator/include/TestHarness.h:MixedTyped
+ // int -> FLOAT32 map
+ {{0, {0, 0, 0.524902f, 0, 0, 0, 0, 1.02116f, 0, 1.35762f, 0, 0.356909f, 0.436415f, 0.0355731f, 0, 0, 0, 0, 0.524902f, 0, 0, 0, 0, 1.02116f, 0, 1.35762f, 0, 0.356909f, 0.436415f, 0.0355731f, 0, 0}}, {1, {0, 0, 0.524901f, 0, 0, 0, 0, 1.02116f, 0, 1.35762f, 0, 0.356909f, 0.436415f, 0.0355727f, 0, 0, 0, 0, 0.524901f, 0, 0, 0, 0, 1.02116f, 0, 1.35762f, 0, 0.356909f, 0.436415f, 0.0355727f, 0, 0}}},
+ // int -> INT32 map
+ {},
+ // int -> QUANT8_ASYMM map
+ {}
+}
+}, // End of an example
diff --git a/nn/runtime/test/generated/examples/svdf_state.example.cpp b/nn/runtime/test/generated/examples/svdf_state.example.cpp
new file mode 100644
index 000000000..ffe02125c
--- /dev/null
+++ b/nn/runtime/test/generated/examples/svdf_state.example.cpp
@@ -0,0 +1,22 @@
+// Generated file (from: svdf_state.mod.py). Do not edit
+// Begin of an example
+{
+//Input(s)
+{ // See tools/test_generator/include/TestHarness.h:MixedTyped
+ // int -> FLOAT32 map
+ {{0, {0.14278367f, -1.64410412f, -0.75222826f, 0.14278367f, -1.64410412f, -0.75222826f}}, {1, {-0.31930989f, -0.36118156f, 0.0079667f, 0.37613347f, 0.22197971f, 0.12416199f, 0.27901134f, 0.27557442f, 0.3905206f, -0.36137494f, -0.06634006f, -0.10640851f}}, {2, {-0.31930989f, 0.37613347f, 0.27901134f, -0.36137494f, -0.36118156f, 0.22197971f, 0.27557442f, -0.06634006f, 0.0079667f, 0.12416199f, 0.3905206f, -0.10640851f, -0.0976817f, 0.15294972f, 0.39635518f, -0.02702999f, 0.39296314f, 0.15785322f, 0.21931258f, 0.31053296f, -0.36916667f, 0.38031587f, -0.21580373f, 0.27072677f, 0.23622236f, 0.34936687f, 0.18174365f, 0.35907319f, -0.17493086f, 0.324846f, -0.10781813f, 0.27201805f, 0.14324132f, -0.23681851f, -0.27115166f, -0.01580888f, -0.14943552f, 0.15465137f, 0.09784451f, -0.0337657f}}, {3, {}}, {4, {0, 0, 0, 0, 0, 0, 0, 0, 0.119996f, 0, 0, 0, 0, 0, 0, 0, 0, -0.166701f, 0, 0, 0, 0, 0, 0, 0, 0, -0.44244f, 0, 0, 0, 0, 0, 0, 0, 0, 0.0805206f, 0, 0, 0, 0, 0, 0, 0, 0, 0.119996f, 0, 0, 0, 0, 0, 0, 0, 0, -0.166701f, 0, 0, 0, 0, 0, 0, 0, 0, -0.44244f, 0, 0, 0, 0, 0, 0, 0, 0, 0.0805206f, 0, 0, 0, 0, 0, 0, 0, 0}}},
+ // int -> INT32 map
+ {{5, {1}}, {6, {0}}},
+ // int -> QUANT8_ASYMM map
+ {}
+},
+//Output(s)
+{ // See tools/test_generator/include/TestHarness.h:MixedTyped
+ // int -> FLOAT32 map
+ {{1, {0.068281f, -0.162217f, -0.152268f, 0.00323521f, 0.068281f, -0.162217f, -0.152268f, 0.00323521f}}, {0, {0, 0, 0, 0, 0, 0, 0, 0.119996f, 0.542235f, 0, 0, 0, 0, 0, 0, 0, -0.166701f, -0.40465f, 0, 0, 0, 0, 0, 0, 0, -0.44244f, -0.706995f, 0, 0, 0, 0, 0, 0, 0, 0.0805206f, 0.137515f, 0, 0, 0, 0, 0, 0, 0, 0.119996f, 0.542235f, 0, 0, 0, 0, 0, 0, 0, -0.166701f, -0.40465f, 0, 0, 0, 0, 0, 0, 0, -0.44244f, -0.706995f, 0, 0, 0, 0, 0, 0, 0, 0.0805206f, 0.137515f, 0, 0, 0, 0, 0, 0, 0, 0}}},
+ // int -> INT32 map
+ {},
+ // int -> QUANT8_ASYMM map
+ {}
+}
+}, // End of an example
diff --git a/nn/runtime/test/generated/models/lstm.model.cpp b/nn/runtime/test/generated/models/lstm.model.cpp
index 528bc5fbb..2308ba84d 100644
--- a/nn/runtime/test/generated/models/lstm.model.cpp
+++ b/nn/runtime/test/generated/models/lstm.model.cpp
@@ -48,6 +48,6 @@ void CreateModel(Model *model) {
}
bool is_ignored(int i) {
- static std::set<int> ignore = {1, 2, 0};
+ static std::set<int> ignore = {0};
return ignore.find(i) != ignore.end();
}
diff --git a/nn/runtime/test/generated/models/lstm2.model.cpp b/nn/runtime/test/generated/models/lstm2.model.cpp
index 4286acd71..cf7a8f401 100644
--- a/nn/runtime/test/generated/models/lstm2.model.cpp
+++ b/nn/runtime/test/generated/models/lstm2.model.cpp
@@ -48,6 +48,6 @@ void CreateModel(Model *model) {
}
bool is_ignored(int i) {
- static std::set<int> ignore = {1, 2, 0};
+ static std::set<int> ignore = {0};
return ignore.find(i) != ignore.end();
}
diff --git a/nn/runtime/test/generated/models/lstm2_state.model.cpp b/nn/runtime/test/generated/models/lstm2_state.model.cpp
new file mode 100644
index 000000000..ec59fe7b0
--- /dev/null
+++ b/nn/runtime/test/generated/models/lstm2_state.model.cpp
@@ -0,0 +1,53 @@
+// Generated file (from: lstm2_state.mod.py). Do not edit
+void CreateModel(Model *model) {
+ OperandType type5(Type::TENSOR_FLOAT32, {0,0});
+ OperandType type3(Type::TENSOR_FLOAT32, {0});
+ OperandType type9(Type::TENSOR_FLOAT32, {1, 12});
+ OperandType type0(Type::TENSOR_FLOAT32, {1, 2});
+ OperandType type6(Type::TENSOR_FLOAT32, {1, 4});
+ OperandType type8(Type::TENSOR_FLOAT32, {1});
+ OperandType type1(Type::TENSOR_FLOAT32, {4, 2});
+ OperandType type2(Type::TENSOR_FLOAT32, {4, 4});
+ OperandType type4(Type::TENSOR_FLOAT32, {4});
+ OperandType type7(Type::TENSOR_INT32, {1});
+ // Phase 1, operands
+ auto input = model->addOperand(&type0);
+ auto input_to_input_weights = model->addOperand(&type1);
+ auto input_to_forget_weights = model->addOperand(&type1);
+ auto input_to_cell_weights = model->addOperand(&type1);
+ auto input_to_output_weights = model->addOperand(&type1);
+ auto recurrent_to_intput_weights = model->addOperand(&type2);
+ auto recurrent_to_forget_weights = model->addOperand(&type2);
+ auto recurrent_to_cell_weights = model->addOperand(&type2);
+ auto recurrent_to_output_weights = model->addOperand(&type2);
+ auto cell_to_input_weights = model->addOperand(&type3);
+ auto cell_to_forget_weights = model->addOperand(&type4);
+ auto cell_to_output_weights = model->addOperand(&type4);
+ auto input_gate_bias = model->addOperand(&type4);
+ auto forget_gate_bias = model->addOperand(&type4);
+ auto cell_gate_bias = model->addOperand(&type4);
+ auto output_gate_bias = model->addOperand(&type4);
+ auto projection_weights = model->addOperand(&type5);
+ auto projection_bias = model->addOperand(&type3);
+ auto output_state_in = model->addOperand(&type6);
+ auto cell_state_in = model->addOperand(&type6);
+ auto activation_param = model->addOperand(&type7);
+ auto cell_clip_param = model->addOperand(&type8);
+ auto proj_clip_param = model->addOperand(&type8);
+ auto scratch_buffer = model->addOperand(&type9);
+ auto output_state_out = model->addOperand(&type6);
+ auto cell_state_out = model->addOperand(&type6);
+ auto output = model->addOperand(&type6);
+ // Phase 2, operations
+ model->addOperation(ANEURALNETWORKS_LSTM, {input, input_to_input_weights, input_to_forget_weights, input_to_cell_weights, input_to_output_weights, recurrent_to_intput_weights, recurrent_to_forget_weights, recurrent_to_cell_weights, recurrent_to_output_weights, cell_to_input_weights, cell_to_forget_weights, cell_to_output_weights, input_gate_bias, forget_gate_bias, cell_gate_bias, output_gate_bias, projection_weights, projection_bias, output_state_in, cell_state_in, activation_param, cell_clip_param, proj_clip_param}, {scratch_buffer, output_state_out, cell_state_out, output});
+ // Phase 3, inputs and outputs
+ model->identifyInputsAndOutputs(
+ {input, input_to_input_weights, input_to_forget_weights, input_to_cell_weights, input_to_output_weights, recurrent_to_intput_weights, recurrent_to_forget_weights, recurrent_to_cell_weights, recurrent_to_output_weights, cell_to_input_weights, cell_to_forget_weights, cell_to_output_weights, input_gate_bias, forget_gate_bias, cell_gate_bias, output_gate_bias, projection_weights, projection_bias, output_state_in, cell_state_in, activation_param, cell_clip_param, proj_clip_param},
+ {scratch_buffer, output_state_out, cell_state_out, output});
+ assert(model->isValid());
+}
+
+bool is_ignored(int i) {
+ static std::set<int> ignore = {0};
+ return ignore.find(i) != ignore.end();
+}
diff --git a/nn/runtime/test/generated/models/lstm2_state2.model.cpp b/nn/runtime/test/generated/models/lstm2_state2.model.cpp
new file mode 100644
index 000000000..60d0e147d
--- /dev/null
+++ b/nn/runtime/test/generated/models/lstm2_state2.model.cpp
@@ -0,0 +1,53 @@
+// Generated file (from: lstm2_state2.mod.py). Do not edit
+void CreateModel(Model *model) {
+ OperandType type5(Type::TENSOR_FLOAT32, {0,0});
+ OperandType type3(Type::TENSOR_FLOAT32, {0});
+ OperandType type9(Type::TENSOR_FLOAT32, {1, 12});
+ OperandType type0(Type::TENSOR_FLOAT32, {1, 2});
+ OperandType type6(Type::TENSOR_FLOAT32, {1, 4});
+ OperandType type8(Type::TENSOR_FLOAT32, {1});
+ OperandType type1(Type::TENSOR_FLOAT32, {4, 2});
+ OperandType type2(Type::TENSOR_FLOAT32, {4, 4});
+ OperandType type4(Type::TENSOR_FLOAT32, {4});
+ OperandType type7(Type::TENSOR_INT32, {1});
+ // Phase 1, operands
+ auto input = model->addOperand(&type0);
+ auto input_to_input_weights = model->addOperand(&type1);
+ auto input_to_forget_weights = model->addOperand(&type1);
+ auto input_to_cell_weights = model->addOperand(&type1);
+ auto input_to_output_weights = model->addOperand(&type1);
+ auto recurrent_to_intput_weights = model->addOperand(&type2);
+ auto recurrent_to_forget_weights = model->addOperand(&type2);
+ auto recurrent_to_cell_weights = model->addOperand(&type2);
+ auto recurrent_to_output_weights = model->addOperand(&type2);
+ auto cell_to_input_weights = model->addOperand(&type3);
+ auto cell_to_forget_weights = model->addOperand(&type4);
+ auto cell_to_output_weights = model->addOperand(&type4);
+ auto input_gate_bias = model->addOperand(&type4);
+ auto forget_gate_bias = model->addOperand(&type4);
+ auto cell_gate_bias = model->addOperand(&type4);
+ auto output_gate_bias = model->addOperand(&type4);
+ auto projection_weights = model->addOperand(&type5);
+ auto projection_bias = model->addOperand(&type3);
+ auto output_state_in = model->addOperand(&type6);
+ auto cell_state_in = model->addOperand(&type6);
+ auto activation_param = model->addOperand(&type7);
+ auto cell_clip_param = model->addOperand(&type8);
+ auto proj_clip_param = model->addOperand(&type8);
+ auto scratch_buffer = model->addOperand(&type9);
+ auto output_state_out = model->addOperand(&type6);
+ auto cell_state_out = model->addOperand(&type6);
+ auto output = model->addOperand(&type6);
+ // Phase 2, operations
+ model->addOperation(ANEURALNETWORKS_LSTM, {input, input_to_input_weights, input_to_forget_weights, input_to_cell_weights, input_to_output_weights, recurrent_to_intput_weights, recurrent_to_forget_weights, recurrent_to_cell_weights, recurrent_to_output_weights, cell_to_input_weights, cell_to_forget_weights, cell_to_output_weights, input_gate_bias, forget_gate_bias, cell_gate_bias, output_gate_bias, projection_weights, projection_bias, output_state_in, cell_state_in, activation_param, cell_clip_param, proj_clip_param}, {scratch_buffer, output_state_out, cell_state_out, output});
+ // Phase 3, inputs and outputs
+ model->identifyInputsAndOutputs(
+ {input, input_to_input_weights, input_to_forget_weights, input_to_cell_weights, input_to_output_weights, recurrent_to_intput_weights, recurrent_to_forget_weights, recurrent_to_cell_weights, recurrent_to_output_weights, cell_to_input_weights, cell_to_forget_weights, cell_to_output_weights, input_gate_bias, forget_gate_bias, cell_gate_bias, output_gate_bias, projection_weights, projection_bias, output_state_in, cell_state_in, activation_param, cell_clip_param, proj_clip_param},
+ {scratch_buffer, output_state_out, cell_state_out, output});
+ assert(model->isValid());
+}
+
+bool is_ignored(int i) {
+ static std::set<int> ignore = {1, 2, 0};
+ return ignore.find(i) != ignore.end();
+}
diff --git a/nn/runtime/test/generated/models/lstm3.model.cpp b/nn/runtime/test/generated/models/lstm3.model.cpp
index 64b00560b..2100fc949 100644
--- a/nn/runtime/test/generated/models/lstm3.model.cpp
+++ b/nn/runtime/test/generated/models/lstm3.model.cpp
@@ -49,6 +49,6 @@ void CreateModel(Model *model) {
}
bool is_ignored(int i) {
- static std::set<int> ignore = {1, 2, 0};
+ static std::set<int> ignore = {0};
return ignore.find(i) != ignore.end();
}
diff --git a/nn/runtime/test/generated/models/lstm3_state.model.cpp b/nn/runtime/test/generated/models/lstm3_state.model.cpp
new file mode 100644
index 000000000..bee11fa10
--- /dev/null
+++ b/nn/runtime/test/generated/models/lstm3_state.model.cpp
@@ -0,0 +1,54 @@
+// Generated file (from: lstm3_state.mod.py). Do not edit
+void CreateModel(Model *model) {
+ OperandType type5(Type::TENSOR_FLOAT32, {0});
+ OperandType type4(Type::TENSOR_FLOAT32, {16,20});
+ OperandType type9(Type::TENSOR_FLOAT32, {1});
+ OperandType type6(Type::TENSOR_FLOAT32, {2, 16});
+ OperandType type7(Type::TENSOR_FLOAT32, {2, 20});
+ OperandType type0(Type::TENSOR_FLOAT32, {2, 5});
+ OperandType type10(Type::TENSOR_FLOAT32, {2, 80});
+ OperandType type2(Type::TENSOR_FLOAT32, {20, 16});
+ OperandType type1(Type::TENSOR_FLOAT32, {20, 5});
+ OperandType type3(Type::TENSOR_FLOAT32, {20});
+ OperandType type8(Type::TENSOR_INT32, {1});
+ // Phase 1, operands
+ auto input = model->addOperand(&type0);
+ auto input_to_input_weights = model->addOperand(&type1);
+ auto input_to_forget_weights = model->addOperand(&type1);
+ auto input_to_cell_weights = model->addOperand(&type1);
+ auto input_to_output_weights = model->addOperand(&type1);
+ auto recurrent_to_intput_weights = model->addOperand(&type2);
+ auto recurrent_to_forget_weights = model->addOperand(&type2);
+ auto recurrent_to_cell_weights = model->addOperand(&type2);
+ auto recurrent_to_output_weights = model->addOperand(&type2);
+ auto cell_to_input_weights = model->addOperand(&type3);
+ auto cell_to_forget_weights = model->addOperand(&type3);
+ auto cell_to_output_weights = model->addOperand(&type3);
+ auto input_gate_bias = model->addOperand(&type3);
+ auto forget_gate_bias = model->addOperand(&type3);
+ auto cell_gate_bias = model->addOperand(&type3);
+ auto output_gate_bias = model->addOperand(&type3);
+ auto projection_weights = model->addOperand(&type4);
+ auto projection_bias = model->addOperand(&type5);
+ auto output_state_in = model->addOperand(&type6);
+ auto cell_state_in = model->addOperand(&type7);
+ auto activation_param = model->addOperand(&type8);
+ auto cell_clip_param = model->addOperand(&type9);
+ auto proj_clip_param = model->addOperand(&type9);
+ auto scratch_buffer = model->addOperand(&type10);
+ auto output_state_out = model->addOperand(&type6);
+ auto cell_state_out = model->addOperand(&type7);
+ auto output = model->addOperand(&type6);
+ // Phase 2, operations
+ model->addOperation(ANEURALNETWORKS_LSTM, {input, input_to_input_weights, input_to_forget_weights, input_to_cell_weights, input_to_output_weights, recurrent_to_intput_weights, recurrent_to_forget_weights, recurrent_to_cell_weights, recurrent_to_output_weights, cell_to_input_weights, cell_to_forget_weights, cell_to_output_weights, input_gate_bias, forget_gate_bias, cell_gate_bias, output_gate_bias, projection_weights, projection_bias, output_state_in, cell_state_in, activation_param, cell_clip_param, proj_clip_param}, {scratch_buffer, output_state_out, cell_state_out, output});
+ // Phase 3, inputs and outputs
+ model->identifyInputsAndOutputs(
+ {input, input_to_input_weights, input_to_forget_weights, input_to_cell_weights, input_to_output_weights, recurrent_to_intput_weights, recurrent_to_forget_weights, recurrent_to_cell_weights, recurrent_to_output_weights, cell_to_input_weights, cell_to_forget_weights, cell_to_output_weights, input_gate_bias, forget_gate_bias, cell_gate_bias, output_gate_bias, projection_weights, projection_bias, output_state_in, cell_state_in, activation_param, cell_clip_param, proj_clip_param},
+ {scratch_buffer, output_state_out, cell_state_out, output});
+ assert(model->isValid());
+}
+
+bool is_ignored(int i) {
+ static std::set<int> ignore = {0};
+ return ignore.find(i) != ignore.end();
+}
diff --git a/nn/runtime/test/generated/models/lstm3_state2.model.cpp b/nn/runtime/test/generated/models/lstm3_state2.model.cpp
new file mode 100644
index 000000000..ae6ba8db3
--- /dev/null
+++ b/nn/runtime/test/generated/models/lstm3_state2.model.cpp
@@ -0,0 +1,54 @@
+// Generated file (from: lstm3_state2.mod.py). Do not edit
+void CreateModel(Model *model) {
+ OperandType type5(Type::TENSOR_FLOAT32, {0});
+ OperandType type4(Type::TENSOR_FLOAT32, {16,20});
+ OperandType type9(Type::TENSOR_FLOAT32, {1});
+ OperandType type6(Type::TENSOR_FLOAT32, {2, 16});
+ OperandType type7(Type::TENSOR_FLOAT32, {2, 20});
+ OperandType type0(Type::TENSOR_FLOAT32, {2, 5});
+ OperandType type10(Type::TENSOR_FLOAT32, {2, 80});
+ OperandType type2(Type::TENSOR_FLOAT32, {20, 16});
+ OperandType type1(Type::TENSOR_FLOAT32, {20, 5});
+ OperandType type3(Type::TENSOR_FLOAT32, {20});
+ OperandType type8(Type::TENSOR_INT32, {1});
+ // Phase 1, operands
+ auto input = model->addOperand(&type0);
+ auto input_to_input_weights = model->addOperand(&type1);
+ auto input_to_forget_weights = model->addOperand(&type1);
+ auto input_to_cell_weights = model->addOperand(&type1);
+ auto input_to_output_weights = model->addOperand(&type1);
+ auto recurrent_to_intput_weights = model->addOperand(&type2);
+ auto recurrent_to_forget_weights = model->addOperand(&type2);
+ auto recurrent_to_cell_weights = model->addOperand(&type2);
+ auto recurrent_to_output_weights = model->addOperand(&type2);
+ auto cell_to_input_weights = model->addOperand(&type3);
+ auto cell_to_forget_weights = model->addOperand(&type3);
+ auto cell_to_output_weights = model->addOperand(&type3);
+ auto input_gate_bias = model->addOperand(&type3);
+ auto forget_gate_bias = model->addOperand(&type3);
+ auto cell_gate_bias = model->addOperand(&type3);
+ auto output_gate_bias = model->addOperand(&type3);
+ auto projection_weights = model->addOperand(&type4);
+ auto projection_bias = model->addOperand(&type5);
+ auto output_state_in = model->addOperand(&type6);
+ auto cell_state_in = model->addOperand(&type7);
+ auto activation_param = model->addOperand(&type8);
+ auto cell_clip_param = model->addOperand(&type9);
+ auto proj_clip_param = model->addOperand(&type9);
+ auto scratch_buffer = model->addOperand(&type10);
+ auto output_state_out = model->addOperand(&type6);
+ auto cell_state_out = model->addOperand(&type7);
+ auto output = model->addOperand(&type6);
+ // Phase 2, operations
+ model->addOperation(ANEURALNETWORKS_LSTM, {input, input_to_input_weights, input_to_forget_weights, input_to_cell_weights, input_to_output_weights, recurrent_to_intput_weights, recurrent_to_forget_weights, recurrent_to_cell_weights, recurrent_to_output_weights, cell_to_input_weights, cell_to_forget_weights, cell_to_output_weights, input_gate_bias, forget_gate_bias, cell_gate_bias, output_gate_bias, projection_weights, projection_bias, output_state_in, cell_state_in, activation_param, cell_clip_param, proj_clip_param}, {scratch_buffer, output_state_out, cell_state_out, output});
+ // Phase 3, inputs and outputs
+ model->identifyInputsAndOutputs(
+ {input, input_to_input_weights, input_to_forget_weights, input_to_cell_weights, input_to_output_weights, recurrent_to_intput_weights, recurrent_to_forget_weights, recurrent_to_cell_weights, recurrent_to_output_weights, cell_to_input_weights, cell_to_forget_weights, cell_to_output_weights, input_gate_bias, forget_gate_bias, cell_gate_bias, output_gate_bias, projection_weights, projection_bias, output_state_in, cell_state_in, activation_param, cell_clip_param, proj_clip_param},
+ {scratch_buffer, output_state_out, cell_state_out, output});
+ assert(model->isValid());
+}
+
+bool is_ignored(int i) {
+ static std::set<int> ignore = {0};
+ return ignore.find(i) != ignore.end();
+}
diff --git a/nn/runtime/test/generated/models/lstm3_state3.model.cpp b/nn/runtime/test/generated/models/lstm3_state3.model.cpp
new file mode 100644
index 000000000..65ab3c18f
--- /dev/null
+++ b/nn/runtime/test/generated/models/lstm3_state3.model.cpp
@@ -0,0 +1,54 @@
+// Generated file (from: lstm3_state3.mod.py). Do not edit
+void CreateModel(Model *model) {
+ OperandType type5(Type::TENSOR_FLOAT32, {0});
+ OperandType type4(Type::TENSOR_FLOAT32, {16,20});
+ OperandType type9(Type::TENSOR_FLOAT32, {1});
+ OperandType type6(Type::TENSOR_FLOAT32, {2, 16});
+ OperandType type7(Type::TENSOR_FLOAT32, {2, 20});
+ OperandType type0(Type::TENSOR_FLOAT32, {2, 5});
+ OperandType type10(Type::TENSOR_FLOAT32, {2, 80});
+ OperandType type2(Type::TENSOR_FLOAT32, {20, 16});
+ OperandType type1(Type::TENSOR_FLOAT32, {20, 5});
+ OperandType type3(Type::TENSOR_FLOAT32, {20});
+ OperandType type8(Type::TENSOR_INT32, {1});
+ // Phase 1, operands
+ auto input = model->addOperand(&type0);
+ auto input_to_input_weights = model->addOperand(&type1);
+ auto input_to_forget_weights = model->addOperand(&type1);
+ auto input_to_cell_weights = model->addOperand(&type1);
+ auto input_to_output_weights = model->addOperand(&type1);
+ auto recurrent_to_intput_weights = model->addOperand(&type2);
+ auto recurrent_to_forget_weights = model->addOperand(&type2);
+ auto recurrent_to_cell_weights = model->addOperand(&type2);
+ auto recurrent_to_output_weights = model->addOperand(&type2);
+ auto cell_to_input_weights = model->addOperand(&type3);
+ auto cell_to_forget_weights = model->addOperand(&type3);
+ auto cell_to_output_weights = model->addOperand(&type3);
+ auto input_gate_bias = model->addOperand(&type3);
+ auto forget_gate_bias = model->addOperand(&type3);
+ auto cell_gate_bias = model->addOperand(&type3);
+ auto output_gate_bias = model->addOperand(&type3);
+ auto projection_weights = model->addOperand(&type4);
+ auto projection_bias = model->addOperand(&type5);
+ auto output_state_in = model->addOperand(&type6);
+ auto cell_state_in = model->addOperand(&type7);
+ auto activation_param = model->addOperand(&type8);
+ auto cell_clip_param = model->addOperand(&type9);
+ auto proj_clip_param = model->addOperand(&type9);
+ auto scratch_buffer = model->addOperand(&type10);
+ auto output_state_out = model->addOperand(&type6);
+ auto cell_state_out = model->addOperand(&type7);
+ auto output = model->addOperand(&type6);
+ // Phase 2, operations
+ model->addOperation(ANEURALNETWORKS_LSTM, {input, input_to_input_weights, input_to_forget_weights, input_to_cell_weights, input_to_output_weights, recurrent_to_intput_weights, recurrent_to_forget_weights, recurrent_to_cell_weights, recurrent_to_output_weights, cell_to_input_weights, cell_to_forget_weights, cell_to_output_weights, input_gate_bias, forget_gate_bias, cell_gate_bias, output_gate_bias, projection_weights, projection_bias, output_state_in, cell_state_in, activation_param, cell_clip_param, proj_clip_param}, {scratch_buffer, output_state_out, cell_state_out, output});
+ // Phase 3, inputs and outputs
+ model->identifyInputsAndOutputs(
+ {input, input_to_input_weights, input_to_forget_weights, input_to_cell_weights, input_to_output_weights, recurrent_to_intput_weights, recurrent_to_forget_weights, recurrent_to_cell_weights, recurrent_to_output_weights, cell_to_input_weights, cell_to_forget_weights, cell_to_output_weights, input_gate_bias, forget_gate_bias, cell_gate_bias, output_gate_bias, projection_weights, projection_bias, output_state_in, cell_state_in, activation_param, cell_clip_param, proj_clip_param},
+ {scratch_buffer, output_state_out, cell_state_out, output});
+ assert(model->isValid());
+}
+
+bool is_ignored(int i) {
+ static std::set<int> ignore = {1, 2, 0};
+ return ignore.find(i) != ignore.end();
+}
diff --git a/nn/runtime/test/generated/models/lstm_state.model.cpp b/nn/runtime/test/generated/models/lstm_state.model.cpp
new file mode 100644
index 000000000..cf7ce867b
--- /dev/null
+++ b/nn/runtime/test/generated/models/lstm_state.model.cpp
@@ -0,0 +1,53 @@
+// Generated file (from: lstm_state.mod.py). Do not edit
+void CreateModel(Model *model) {
+ OperandType type5(Type::TENSOR_FLOAT32, {0,0});
+ OperandType type3(Type::TENSOR_FLOAT32, {0});
+ OperandType type9(Type::TENSOR_FLOAT32, {1, 16});
+ OperandType type0(Type::TENSOR_FLOAT32, {1, 2});
+ OperandType type6(Type::TENSOR_FLOAT32, {1, 4});
+ OperandType type8(Type::TENSOR_FLOAT32, {1});
+ OperandType type1(Type::TENSOR_FLOAT32, {4, 2});
+ OperandType type2(Type::TENSOR_FLOAT32, {4, 4});
+ OperandType type4(Type::TENSOR_FLOAT32, {4});
+ OperandType type7(Type::TENSOR_INT32, {1});
+ // Phase 1, operands
+ auto input = model->addOperand(&type0);
+ auto input_to_input_weights = model->addOperand(&type1);
+ auto input_to_forget_weights = model->addOperand(&type1);
+ auto input_to_cell_weights = model->addOperand(&type1);
+ auto input_to_output_weights = model->addOperand(&type1);
+ auto recurrent_to_intput_weights = model->addOperand(&type2);
+ auto recurrent_to_forget_weights = model->addOperand(&type2);
+ auto recurrent_to_cell_weights = model->addOperand(&type2);
+ auto recurrent_to_output_weights = model->addOperand(&type2);
+ auto cell_to_input_weights = model->addOperand(&type3);
+ auto cell_to_forget_weights = model->addOperand(&type3);
+ auto cell_to_output_weights = model->addOperand(&type3);
+ auto input_gate_bias = model->addOperand(&type4);
+ auto forget_gate_bias = model->addOperand(&type4);
+ auto cell_gate_bias = model->addOperand(&type4);
+ auto output_gate_bias = model->addOperand(&type4);
+ auto projection_weights = model->addOperand(&type5);
+ auto projection_bias = model->addOperand(&type3);
+ auto output_state_in = model->addOperand(&type6);
+ auto cell_state_in = model->addOperand(&type6);
+ auto activation_param = model->addOperand(&type7);
+ auto cell_clip_param = model->addOperand(&type8);
+ auto proj_clip_param = model->addOperand(&type8);
+ auto scratch_buffer = model->addOperand(&type9);
+ auto output_state_out = model->addOperand(&type6);
+ auto cell_state_out = model->addOperand(&type6);
+ auto output = model->addOperand(&type6);
+ // Phase 2, operations
+ model->addOperation(ANEURALNETWORKS_LSTM, {input, input_to_input_weights, input_to_forget_weights, input_to_cell_weights, input_to_output_weights, recurrent_to_intput_weights, recurrent_to_forget_weights, recurrent_to_cell_weights, recurrent_to_output_weights, cell_to_input_weights, cell_to_forget_weights, cell_to_output_weights, input_gate_bias, forget_gate_bias, cell_gate_bias, output_gate_bias, projection_weights, projection_bias, output_state_in, cell_state_in, activation_param, cell_clip_param, proj_clip_param}, {scratch_buffer, output_state_out, cell_state_out, output});
+ // Phase 3, inputs and outputs
+ model->identifyInputsAndOutputs(
+ {input, input_to_input_weights, input_to_forget_weights, input_to_cell_weights, input_to_output_weights, recurrent_to_intput_weights, recurrent_to_forget_weights, recurrent_to_cell_weights, recurrent_to_output_weights, cell_to_input_weights, cell_to_forget_weights, cell_to_output_weights, input_gate_bias, forget_gate_bias, cell_gate_bias, output_gate_bias, projection_weights, projection_bias, output_state_in, cell_state_in, activation_param, cell_clip_param, proj_clip_param},
+ {scratch_buffer, output_state_out, cell_state_out, output});
+ assert(model->isValid());
+}
+
+bool is_ignored(int i) {
+ static std::set<int> ignore = {0};
+ return ignore.find(i) != ignore.end();
+}
diff --git a/nn/runtime/test/generated/models/lstm_state2.model.cpp b/nn/runtime/test/generated/models/lstm_state2.model.cpp
new file mode 100644
index 000000000..1cdf66622
--- /dev/null
+++ b/nn/runtime/test/generated/models/lstm_state2.model.cpp
@@ -0,0 +1,53 @@
+// Generated file (from: lstm_state2.mod.py). Do not edit
+void CreateModel(Model *model) {
+ OperandType type5(Type::TENSOR_FLOAT32, {0,0});
+ OperandType type3(Type::TENSOR_FLOAT32, {0});
+ OperandType type9(Type::TENSOR_FLOAT32, {1, 16});
+ OperandType type0(Type::TENSOR_FLOAT32, {1, 2});
+ OperandType type6(Type::TENSOR_FLOAT32, {1, 4});
+ OperandType type8(Type::TENSOR_FLOAT32, {1});
+ OperandType type1(Type::TENSOR_FLOAT32, {4, 2});
+ OperandType type2(Type::TENSOR_FLOAT32, {4, 4});
+ OperandType type4(Type::TENSOR_FLOAT32, {4});
+ OperandType type7(Type::TENSOR_INT32, {1});
+ // Phase 1, operands
+ auto input = model->addOperand(&type0);
+ auto input_to_input_weights = model->addOperand(&type1);
+ auto input_to_forget_weights = model->addOperand(&type1);
+ auto input_to_cell_weights = model->addOperand(&type1);
+ auto input_to_output_weights = model->addOperand(&type1);
+ auto recurrent_to_intput_weights = model->addOperand(&type2);
+ auto recurrent_to_forget_weights = model->addOperand(&type2);
+ auto recurrent_to_cell_weights = model->addOperand(&type2);
+ auto recurrent_to_output_weights = model->addOperand(&type2);
+ auto cell_to_input_weights = model->addOperand(&type3);
+ auto cell_to_forget_weights = model->addOperand(&type3);
+ auto cell_to_output_weights = model->addOperand(&type3);
+ auto input_gate_bias = model->addOperand(&type4);
+ auto forget_gate_bias = model->addOperand(&type4);
+ auto cell_gate_bias = model->addOperand(&type4);
+ auto output_gate_bias = model->addOperand(&type4);
+ auto projection_weights = model->addOperand(&type5);
+ auto projection_bias = model->addOperand(&type3);
+ auto output_state_in = model->addOperand(&type6);
+ auto cell_state_in = model->addOperand(&type6);
+ auto activation_param = model->addOperand(&type7);
+ auto cell_clip_param = model->addOperand(&type8);
+ auto proj_clip_param = model->addOperand(&type8);
+ auto scratch_buffer = model->addOperand(&type9);
+ auto output_state_out = model->addOperand(&type6);
+ auto cell_state_out = model->addOperand(&type6);
+ auto output = model->addOperand(&type6);
+ // Phase 2, operations
+ model->addOperation(ANEURALNETWORKS_LSTM, {input, input_to_input_weights, input_to_forget_weights, input_to_cell_weights, input_to_output_weights, recurrent_to_intput_weights, recurrent_to_forget_weights, recurrent_to_cell_weights, recurrent_to_output_weights, cell_to_input_weights, cell_to_forget_weights, cell_to_output_weights, input_gate_bias, forget_gate_bias, cell_gate_bias, output_gate_bias, projection_weights, projection_bias, output_state_in, cell_state_in, activation_param, cell_clip_param, proj_clip_param}, {scratch_buffer, output_state_out, cell_state_out, output});
+ // Phase 3, inputs and outputs
+ model->identifyInputsAndOutputs(
+ {input, input_to_input_weights, input_to_forget_weights, input_to_cell_weights, input_to_output_weights, recurrent_to_intput_weights, recurrent_to_forget_weights, recurrent_to_cell_weights, recurrent_to_output_weights, cell_to_input_weights, cell_to_forget_weights, cell_to_output_weights, input_gate_bias, forget_gate_bias, cell_gate_bias, output_gate_bias, projection_weights, projection_bias, output_state_in, cell_state_in, activation_param, cell_clip_param, proj_clip_param},
+ {scratch_buffer, output_state_out, cell_state_out, output});
+ assert(model->isValid());
+}
+
+bool is_ignored(int i) {
+ static std::set<int> ignore = {1, 2, 0};
+ return ignore.find(i) != ignore.end();
+}
diff --git a/nn/runtime/test/generated/models/rnn_state.model.cpp b/nn/runtime/test/generated/models/rnn_state.model.cpp
new file mode 100644
index 000000000..489575937
--- /dev/null
+++ b/nn/runtime/test/generated/models/rnn_state.model.cpp
@@ -0,0 +1,30 @@
+// Generated file (from: rnn_state.mod.py). Do not edit
+void CreateModel(Model *model) {
+ OperandType type2(Type::TENSOR_FLOAT32, {16, 16});
+ OperandType type1(Type::TENSOR_FLOAT32, {16, 8});
+ OperandType type3(Type::TENSOR_FLOAT32, {16});
+ OperandType type4(Type::TENSOR_FLOAT32, {2, 16});
+ OperandType type0(Type::TENSOR_FLOAT32, {2, 8});
+ OperandType type5(Type::TENSOR_INT32, {1});
+ // Phase 1, operands
+ auto input = model->addOperand(&type0);
+ auto weights = model->addOperand(&type1);
+ auto recurrent_weights = model->addOperand(&type2);
+ auto bias = model->addOperand(&type3);
+ auto hidden_state_in = model->addOperand(&type4);
+ auto activation_param = model->addOperand(&type5);
+ auto hidden_state_out = model->addOperand(&type4);
+ auto output = model->addOperand(&type4);
+ // Phase 2, operations
+ model->addOperation(ANEURALNETWORKS_RNN, {input, weights, recurrent_weights, bias, hidden_state_in, activation_param}, {hidden_state_out, output});
+ // Phase 3, inputs and outputs
+ model->identifyInputsAndOutputs(
+ {input, weights, recurrent_weights, bias, hidden_state_in, activation_param},
+ {hidden_state_out, output});
+ assert(model->isValid());
+}
+
+bool is_ignored(int i) {
+ static std::set<int> ignore = {0};
+ return ignore.find(i) != ignore.end();
+}
diff --git a/nn/runtime/test/generated/models/svdf_state.model.cpp b/nn/runtime/test/generated/models/svdf_state.model.cpp
new file mode 100644
index 000000000..f63662d3b
--- /dev/null
+++ b/nn/runtime/test/generated/models/svdf_state.model.cpp
@@ -0,0 +1,32 @@
+// Generated file (from: svdf_state.mod.py). Do not edit
+void CreateModel(Model *model) {
+ OperandType type0(Type::TENSOR_FLOAT32, {2, 3});
+ OperandType type4(Type::TENSOR_FLOAT32, {2, 40});
+ OperandType type6(Type::TENSOR_FLOAT32, {2, 4});
+ OperandType type2(Type::TENSOR_FLOAT32, {4, 10});
+ OperandType type1(Type::TENSOR_FLOAT32, {4, 3});
+ OperandType type3(Type::TENSOR_FLOAT32, {4});
+ OperandType type5(Type::TENSOR_INT32, {1});
+ // Phase 1, operands
+ auto input = model->addOperand(&type0);
+ auto weights_feature = model->addOperand(&type1);
+ auto weights_time = model->addOperand(&type2);
+ auto bias = model->addOperand(&type3);
+ auto state_in = model->addOperand(&type4);
+ auto rank_param = model->addOperand(&type5);
+ auto activation_param = model->addOperand(&type5);
+ auto state_out = model->addOperand(&type4);
+ auto output = model->addOperand(&type6);
+ // Phase 2, operations
+ model->addOperation(ANEURALNETWORKS_SVDF, {input, weights_feature, weights_time, bias, state_in, rank_param, activation_param}, {state_out, output});
+ // Phase 3, inputs and outputs
+ model->identifyInputsAndOutputs(
+ {input, weights_feature, weights_time, bias, state_in, rank_param, activation_param},
+ {state_out, output});
+ assert(model->isValid());
+}
+
+bool is_ignored(int i) {
+ static std::set<int> ignore = {};
+ return ignore.find(i) != ignore.end();
+}
diff --git a/nn/runtime/test/specs/generate_test.sh b/nn/runtime/test/specs/generate_test.sh
index 0eccfeb0b..1f3407b9c 100755
--- a/nn/runtime/test/specs/generate_test.sh
+++ b/nn/runtime/test/specs/generate_test.sh
@@ -16,9 +16,16 @@
function generate_one_testcase {
# Generate one testcase
BASENAME=`basename -s .mod.py $1`
+ EXAMPLE="-e ../generated/examples/$BASENAME.example.cpp"
+ # Mobilenet quantized has its example file generated elsewhere, so we
+ # need make sure it does not get overwritten.
+ if [ $1 = "mobilenet_quantized.mod.py" ]; then
+ (>&2 echo "Skipping mobilenet quantized example generation")
+ EXAMPLE=
+ fi
+
../../../tools/test_generator/test_generator.py ./`basename $1`\
- -m ../generated/models/$BASENAME.model.cpp \
- -e ../generated/examples/$BASENAME.example.cpp
+ -m ../generated/models/$BASENAME.model.cpp $EXAMPLE
# Paste these lines into TestGenerated.cpp
echo
echo namespace $BASENAME {
diff --git a/nn/runtime/test/specs/generate_vts_test.sh b/nn/runtime/test/specs/generate_vts_test.sh
index 76aa32bc2..ccbc3eb25 100755
--- a/nn/runtime/test/specs/generate_vts_test.sh
+++ b/nn/runtime/test/specs/generate_vts_test.sh
@@ -47,6 +47,10 @@ echo "// DO NOT EDIT;" > $OUTFILE
echo "// Generated by ml/nn/runtime/test/specs/generate_vts_test.sh" >> $OUTFILE
for f in *.mod.py;
do
+ if [ $f = "mobilenet_quantized.mod.py" ]; then
+ echo "Skipping mobilenet quantized"
+ continue
+ fi
echo "Processing $f"
generate_one_testcase $f >> $OUTFILE
done
diff --git a/nn/runtime/test/specs/lstm.mod.py b/nn/runtime/test/specs/lstm.mod.py
index cb1bf6010..e670d2758 100644
--- a/nn/runtime/test/specs/lstm.mod.py
+++ b/nn/runtime/test/specs/lstm.mod.py
@@ -56,8 +56,8 @@ cell_clip_param = Input("cell_clip_param", "TENSOR_FLOAT32", "{1}")
proj_clip_param = Input("proj_clip_param", "TENSOR_FLOAT32", "{1}")
scratch_buffer = IgnoredOutput("scratch_buffer", "TENSOR_FLOAT32", "{%d, %d}" % (n_batch, (n_cell * 4)))
-output_state_out = IgnoredOutput("output_state_out", "TENSOR_FLOAT32", "{%d, %d}" % (n_batch, n_output))
-cell_state_out = IgnoredOutput("cell_state_out", "TENSOR_FLOAT32", "{%d, %d}" % (n_batch, n_cell))
+output_state_out = Output("output_state_out", "TENSOR_FLOAT32", "{%d, %d}" % (n_batch, n_output))
+cell_state_out = Output("cell_state_out", "TENSOR_FLOAT32", "{%d, %d}" % (n_batch, n_cell))
output = Output("output", "TENSOR_FLOAT32", "{%d, %d}" % (n_batch, n_output))
model = model.Operation("LSTM",
@@ -136,26 +136,17 @@ input0 = {input_to_input_weights: [-0.45018822, -0.02338299, -0.0870589, -0.345
proj_clip_param: [0.],
}
-# Instantiate examples
-# TODO: Add more examples after fixing the reference issue
-test_inputs = [
- [2., 3.],
-# [3., 4.],[1., 1.]
-]
-golden_outputs = [
- [-0.02973187, 0.1229473, 0.20885126, -0.15358765,],
-# [-0.03716109, 0.12507336, 0.41193449, -0.20860538],
-# [-0.15053082, 0.09120187, 0.24278517, -0.12222792]
-]
-
-for (input_tensor, output_tensor) in zip(test_inputs, golden_outputs):
- output0 = {
- scratch_buffer: [ 0 for x in range(n_batch * n_cell * 4) ],
- cell_state_out: [ 0 for x in range(n_batch * n_cell) ],
- output_state_out: [ 0 for x in range(n_batch * n_output) ],
- output: output_tensor
- }
- input0[input] = input_tensor
- input0[output_state_in] = [ 0 for _ in range(n_batch * n_output) ]
- input0[cell_state_in] = [ 0 for _ in range(n_batch * n_cell) ]
- Example((input0, output0))
+test_input = [2., 3.]
+output_state = [0, 0, 0, 0]
+cell_state = [0, 0, 0, 0]
+golden_output = [-0.02973187, 0.1229473, 0.20885126, -0.15358765,]
+output0 = {
+ scratch_buffer: [ 0 for x in range(n_batch * n_cell * 4) ],
+ cell_state_out: [ -0.145439, 0.157475, 0.293663, -0.277353 ],
+ output_state_out: [ -0.0297319, 0.122947, 0.208851, -0.153588 ],
+ output: golden_output
+}
+input0[input] = test_input
+input0[output_state_in] = output_state
+input0[cell_state_in] = cell_state
+Example((input0, output0))
diff --git a/nn/runtime/test/specs/lstm2.mod.py b/nn/runtime/test/specs/lstm2.mod.py
index d5afb0cd9..580464f4f 100644
--- a/nn/runtime/test/specs/lstm2.mod.py
+++ b/nn/runtime/test/specs/lstm2.mod.py
@@ -56,8 +56,8 @@ cell_clip_param = Input("cell_clip_param", "TENSOR_FLOAT32", "{1}")
proj_clip_param = Input("proj_clip_param", "TENSOR_FLOAT32", "{1}")
scratch_buffer = IgnoredOutput("scratch_buffer", "TENSOR_FLOAT32", "{%d, %d}" % (n_batch, n_cell * 3))
-output_state_out = IgnoredOutput("output_state_out", "TENSOR_FLOAT32", "{%d, %d}" % (n_batch, n_output))
-cell_state_out = IgnoredOutput("cell_state_out", "TENSOR_FLOAT32", "{%d, %d}" % (n_batch, n_cell))
+output_state_out = Output("output_state_out", "TENSOR_FLOAT32", "{%d, %d}" % (n_batch, n_output))
+cell_state_out = Output("cell_state_out", "TENSOR_FLOAT32", "{%d, %d}" % (n_batch, n_cell))
output = Output("output", "TENSOR_FLOAT32", "{%d, %d}" % (n_batch, n_output))
model = model.Operation("LSTM",
@@ -134,25 +134,13 @@ input0 = {input_to_input_weights:[],
output0 = {
scratch_buffer: [ 0 for x in range(n_batch * n_cell * 4) ],
- cell_state_out: [ 0 for x in range(n_batch * n_cell) ],
- output_state_out: [ 0 for x in range(n_batch * n_output) ],
+ cell_state_out: [ -0.760444, -0.0180416, 0.182264, -0.0649371 ],
+ output_state_out: [ -0.364445, -0.00352185, 0.128866, -0.0516365 ],
}
-# Instantiate examples
-# TODO: Add more examples after fixing the reference issue
-test_inputs = [
- [2., 3.],
-# [3., 4.],[1., 1.]
-]
-golden_outputs = [
- [-0.36444446, -0.00352185, 0.12886585, -0.05163646],
-# [-0.42312205, -0.01218222, 0.24201041, -0.08124574],
-# [-0.358325, -0.04621704, 0.21641694, -0.06471302]
-]
-
-for (input_tensor, output_tensor) in zip(test_inputs, golden_outputs):
- input0[input] = input_tensor
- input0[cell_state_in] = [ 0 for _ in range(n_batch * n_cell) ]
- input0[output_state_in] = [ 0 for _ in range(n_batch * n_output) ]
- output0[output] = output_tensor
- Example((input0, output0))
+input0[input] = [2., 3.]
+input0[output_state_in] = [ 0 for _ in range(n_batch * n_output) ]
+input0[cell_state_in] = [ 0 for _ in range(n_batch * n_cell) ]
+output0[output] = [-0.36444446, -0.00352185, 0.12886585, -0.05163646]
+
+Example((input0, output0))
diff --git a/nn/runtime/test/specs/lstm2_state.mod.py b/nn/runtime/test/specs/lstm2_state.mod.py
new file mode 100644
index 000000000..a89f265b8
--- /dev/null
+++ b/nn/runtime/test/specs/lstm2_state.mod.py
@@ -0,0 +1,145 @@
+#
+# Copyright (C) 2017 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+# LSTM Test, With Cifg, With Peephole, No Projection, No Clipping.
+
+model = Model()
+
+n_batch = 1
+n_input = 2
+# n_cell and n_output have the same size when there is no projection.
+n_cell = 4
+n_output = 4
+
+input = Input("input", "TENSOR_FLOAT32", "{%d, %d}" % (n_batch, n_input))
+
+input_to_input_weights = Input("input_to_input_weights", "TENSOR_FLOAT32", "{%d, %d}" % (n_cell, n_input))
+input_to_forget_weights = Input("input_to_forget_weights", "TENSOR_FLOAT32", "{%d, %d}" % (n_cell, n_input))
+input_to_cell_weights = Input("input_to_cell_weights", "TENSOR_FLOAT32", "{%d, %d}" % (n_cell, n_input))
+input_to_output_weights = Input("input_to_output_weights", "TENSOR_FLOAT32", "{%d, %d}" % (n_cell, n_input))
+
+recurrent_to_input_weights = Input("recurrent_to_intput_weights", "TENSOR_FLOAT32", "{%d, %d}" % (n_cell, n_output))
+recurrent_to_forget_weights = Input("recurrent_to_forget_weights", "TENSOR_FLOAT32", "{%d, %d}" % (n_cell, n_output))
+recurrent_to_cell_weights = Input("recurrent_to_cell_weights", "TENSOR_FLOAT32", "{%d, %d}" % (n_cell, n_output))
+recurrent_to_output_weights = Input("recurrent_to_output_weights", "TENSOR_FLOAT32", "{%d, %d}" % (n_cell, n_output))
+
+cell_to_input_weights = Input("cell_to_input_weights", "TENSOR_FLOAT32", "{0}")
+cell_to_forget_weights = Input("cell_to_forget_weights", "TENSOR_FLOAT32", "{%d}" % (n_cell))
+cell_to_output_weights = Input("cell_to_output_weights", "TENSOR_FLOAT32", "{%d}" % (n_cell))
+
+input_gate_bias = Input("input_gate_bias", "TENSOR_FLOAT32", "{%d}"%(n_cell))
+forget_gate_bias = Input("forget_gate_bias", "TENSOR_FLOAT32", "{%d}"%(n_cell))
+cell_gate_bias = Input("cell_gate_bias", "TENSOR_FLOAT32", "{%d}"%(n_cell))
+output_gate_bias = Input("output_gate_bias", "TENSOR_FLOAT32", "{%d}"%(n_cell))
+
+projection_weights = Input("projection_weights", "TENSOR_FLOAT32", "{0,0}")
+projection_bias = Input("projection_bias", "TENSOR_FLOAT32", "{0}")
+
+output_state_in = Input("output_state_in", "TENSOR_FLOAT32", "{%d, %d}" % (n_batch, n_output))
+cell_state_in = Input("cell_state_in", "TENSOR_FLOAT32", "{%d, %d}" % (n_batch, n_cell))
+
+activation_param = Input("activation_param", "TENSOR_INT32", "{1}");
+cell_clip_param = Input("cell_clip_param", "TENSOR_FLOAT32", "{1}")
+proj_clip_param = Input("proj_clip_param", "TENSOR_FLOAT32", "{1}")
+
+scratch_buffer = IgnoredOutput("scratch_buffer", "TENSOR_FLOAT32", "{%d, %d}" % (n_batch, n_cell * 3))
+output_state_out = Output("output_state_out", "TENSOR_FLOAT32", "{%d, %d}" % (n_batch, n_output))
+cell_state_out = Output("cell_state_out", "TENSOR_FLOAT32", "{%d, %d}" % (n_batch, n_cell))
+output = Output("output", "TENSOR_FLOAT32", "{%d, %d}" % (n_batch, n_output))
+
+model = model.Operation("LSTM",
+ input,
+
+ input_to_input_weights,
+ input_to_forget_weights,
+ input_to_cell_weights,
+ input_to_output_weights,
+
+ recurrent_to_input_weights,
+ recurrent_to_forget_weights,
+ recurrent_to_cell_weights,
+ recurrent_to_output_weights,
+
+ cell_to_input_weights,
+ cell_to_forget_weights,
+ cell_to_output_weights,
+
+ input_gate_bias,
+ forget_gate_bias,
+ cell_gate_bias,
+ output_gate_bias,
+
+ projection_weights,
+ projection_bias,
+
+ output_state_in,
+ cell_state_in,
+
+ activation_param,
+ cell_clip_param,
+ proj_clip_param
+).To([scratch_buffer, output_state_out, cell_state_out, output])
+
+input0 = {input_to_input_weights:[],
+ input_to_cell_weights: [-0.49770179, -0.27711356, -0.09624726, 0.05100781, 0.04717243, 0.48944736, -0.38535351, -0.17212132],
+ input_to_forget_weights: [-0.55291498, -0.42866567, 0.13056988, -0.3633365, -0.22755712, 0.28253698, 0.24407166, 0.33826375],
+ input_to_output_weights: [0.10725588, -0.02335852, -0.55932593, -0.09426838, -0.44257352, 0.54939759, 0.01533556, 0.42751634],
+
+ input_gate_bias: [],
+ forget_gate_bias: [1.,1.,1.,1.],
+ cell_gate_bias: [0.,0.,0.,0.],
+ output_gate_bias: [0.,0.,0.,0.],
+
+ recurrent_to_input_weights: [],
+ recurrent_to_cell_weights: [
+ 0.54066205, -0.32668582, -0.43562764, -0.56094903, 0.42957711,
+ 0.01841056, -0.32764608, -0.33027974, -0.10826075, 0.20675004,
+ 0.19069612, -0.03026325, -0.54532051, 0.33003211, 0.44901288,
+ 0.21193194],
+
+ recurrent_to_forget_weights: [
+ -0.13832897, -0.0515101, -0.2359007, -0.16661474, -0.14340827,
+ 0.36986142, 0.23414481, 0.55899, 0.10798943, -0.41174671, 0.17751795,
+ -0.34484994, -0.35874045, -0.11352962, 0.27268326, 0.54058349],
+
+ recurrent_to_output_weights: [
+ 0.41613156, 0.42610586, -0.16495961, -0.5663873, 0.30579174, -0.05115908,
+ -0.33941799, 0.23364776, 0.11178309, 0.09481031, -0.26424935, 0.46261835,
+ 0.50248802, 0.26114327, -0.43736315, 0.33149987],
+
+ cell_to_input_weights: [],
+ cell_to_forget_weights: [0.47485286, -0.51955009, -0.24458408, 0.31544167],
+ cell_to_output_weights: [-0.17135078, 0.82760304, 0.85573703, -0.77109635],
+
+ projection_weights: [],
+ projection_bias: [],
+
+ activation_param: [4], # Tanh
+ cell_clip_param: [0.],
+ proj_clip_param: [0.],
+}
+
+output0 = {
+ scratch_buffer: [ 0 for x in range(n_batch * n_cell * 4) ],
+ cell_state_out: [ -0.978419, -0.139203, 0.338163, -0.0983904 ],
+ output_state_out: [ -0.423122, -0.0121822, 0.24201, -0.0812458 ],
+}
+
+input0[input] = [3., 4.]
+input0[output_state_in] = [-0.364445, -0.00352185, 0.128866, -0.0516365]
+input0[cell_state_in] = [-0.760444, -0.0180416, 0.182264, -0.0649371]
+output0[output] = [-0.42312205, -0.01218222, 0.24201041, -0.08124574]
+Example((input0, output0))
diff --git a/nn/runtime/test/specs/lstm2_state2.mod.py b/nn/runtime/test/specs/lstm2_state2.mod.py
new file mode 100644
index 000000000..3e84440df
--- /dev/null
+++ b/nn/runtime/test/specs/lstm2_state2.mod.py
@@ -0,0 +1,146 @@
+#
+# Copyright (C) 2017 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+# LSTM Test, With Cifg, With Peephole, No Projection, No Clipping.
+
+model = Model()
+
+n_batch = 1
+n_input = 2
+# n_cell and n_output have the same size when there is no projection.
+n_cell = 4
+n_output = 4
+
+input = Input("input", "TENSOR_FLOAT32", "{%d, %d}" % (n_batch, n_input))
+
+input_to_input_weights = Input("input_to_input_weights", "TENSOR_FLOAT32", "{%d, %d}" % (n_cell, n_input))
+input_to_forget_weights = Input("input_to_forget_weights", "TENSOR_FLOAT32", "{%d, %d}" % (n_cell, n_input))
+input_to_cell_weights = Input("input_to_cell_weights", "TENSOR_FLOAT32", "{%d, %d}" % (n_cell, n_input))
+input_to_output_weights = Input("input_to_output_weights", "TENSOR_FLOAT32", "{%d, %d}" % (n_cell, n_input))
+
+recurrent_to_input_weights = Input("recurrent_to_intput_weights", "TENSOR_FLOAT32", "{%d, %d}" % (n_cell, n_output))
+recurrent_to_forget_weights = Input("recurrent_to_forget_weights", "TENSOR_FLOAT32", "{%d, %d}" % (n_cell, n_output))
+recurrent_to_cell_weights = Input("recurrent_to_cell_weights", "TENSOR_FLOAT32", "{%d, %d}" % (n_cell, n_output))
+recurrent_to_output_weights = Input("recurrent_to_output_weights", "TENSOR_FLOAT32", "{%d, %d}" % (n_cell, n_output))
+
+cell_to_input_weights = Input("cell_to_input_weights", "TENSOR_FLOAT32", "{0}")
+cell_to_forget_weights = Input("cell_to_forget_weights", "TENSOR_FLOAT32", "{%d}" % (n_cell))
+cell_to_output_weights = Input("cell_to_output_weights", "TENSOR_FLOAT32", "{%d}" % (n_cell))
+
+input_gate_bias = Input("input_gate_bias", "TENSOR_FLOAT32", "{%d}"%(n_cell))
+forget_gate_bias = Input("forget_gate_bias", "TENSOR_FLOAT32", "{%d}"%(n_cell))
+cell_gate_bias = Input("cell_gate_bias", "TENSOR_FLOAT32", "{%d}"%(n_cell))
+output_gate_bias = Input("output_gate_bias", "TENSOR_FLOAT32", "{%d}"%(n_cell))
+
+projection_weights = Input("projection_weights", "TENSOR_FLOAT32", "{0,0}")
+projection_bias = Input("projection_bias", "TENSOR_FLOAT32", "{0}")
+
+output_state_in = Input("output_state_in", "TENSOR_FLOAT32", "{%d, %d}" % (n_batch, n_output))
+cell_state_in = Input("cell_state_in", "TENSOR_FLOAT32", "{%d, %d}" % (n_batch, n_cell))
+
+activation_param = Input("activation_param", "TENSOR_INT32", "{1}");
+cell_clip_param = Input("cell_clip_param", "TENSOR_FLOAT32", "{1}")
+proj_clip_param = Input("proj_clip_param", "TENSOR_FLOAT32", "{1}")
+
+scratch_buffer = IgnoredOutput("scratch_buffer", "TENSOR_FLOAT32", "{%d, %d}" % (n_batch, n_cell * 3))
+output_state_out = IgnoredOutput("output_state_out", "TENSOR_FLOAT32", "{%d, %d}" % (n_batch, n_output))
+cell_state_out = IgnoredOutput("cell_state_out", "TENSOR_FLOAT32", "{%d, %d}" % (n_batch, n_cell))
+output = Output("output", "TENSOR_FLOAT32", "{%d, %d}" % (n_batch, n_output))
+
+model = model.Operation("LSTM",
+ input,
+
+ input_to_input_weights,
+ input_to_forget_weights,
+ input_to_cell_weights,
+ input_to_output_weights,
+
+ recurrent_to_input_weights,
+ recurrent_to_forget_weights,
+ recurrent_to_cell_weights,
+ recurrent_to_output_weights,
+
+ cell_to_input_weights,
+ cell_to_forget_weights,
+ cell_to_output_weights,
+
+ input_gate_bias,
+ forget_gate_bias,
+ cell_gate_bias,
+ output_gate_bias,
+
+ projection_weights,
+ projection_bias,
+
+ output_state_in,
+ cell_state_in,
+
+ activation_param,
+ cell_clip_param,
+ proj_clip_param
+).To([scratch_buffer, output_state_out, cell_state_out, output])
+
+input0 = {input_to_input_weights:[],
+ input_to_cell_weights: [-0.49770179, -0.27711356, -0.09624726, 0.05100781, 0.04717243, 0.48944736, -0.38535351, -0.17212132],
+ input_to_forget_weights: [-0.55291498, -0.42866567, 0.13056988, -0.3633365, -0.22755712, 0.28253698, 0.24407166, 0.33826375],
+ input_to_output_weights: [0.10725588, -0.02335852, -0.55932593, -0.09426838, -0.44257352, 0.54939759, 0.01533556, 0.42751634],
+
+ input_gate_bias: [],
+ forget_gate_bias: [1.,1.,1.,1.],
+ cell_gate_bias: [0.,0.,0.,0.],
+ output_gate_bias: [0.,0.,0.,0.],
+
+ recurrent_to_input_weights: [],
+ recurrent_to_cell_weights: [
+ 0.54066205, -0.32668582, -0.43562764, -0.56094903, 0.42957711,
+ 0.01841056, -0.32764608, -0.33027974, -0.10826075, 0.20675004,
+ 0.19069612, -0.03026325, -0.54532051, 0.33003211, 0.44901288,
+ 0.21193194],
+
+ recurrent_to_forget_weights: [
+ -0.13832897, -0.0515101, -0.2359007, -0.16661474, -0.14340827,
+ 0.36986142, 0.23414481, 0.55899, 0.10798943, -0.41174671, 0.17751795,
+ -0.34484994, -0.35874045, -0.11352962, 0.27268326, 0.54058349],
+
+ recurrent_to_output_weights: [
+ 0.41613156, 0.42610586, -0.16495961, -0.5663873, 0.30579174, -0.05115908,
+ -0.33941799, 0.23364776, 0.11178309, 0.09481031, -0.26424935, 0.46261835,
+ 0.50248802, 0.26114327, -0.43736315, 0.33149987],
+
+ cell_to_input_weights: [],
+ cell_to_forget_weights: [0.47485286, -0.51955009, -0.24458408, 0.31544167],
+ cell_to_output_weights: [-0.17135078, 0.82760304, 0.85573703, -0.77109635],
+
+ projection_weights: [],
+ projection_bias: [],
+
+ activation_param: [4], # Tanh
+ cell_clip_param: [0.],
+ proj_clip_param: [0.],
+}
+
+output0 = {
+ scratch_buffer: [ 0 for x in range(n_batch * n_cell * 4) ],
+ cell_state_out: [ 0 for x in range(n_batch * n_cell) ],
+ output_state_out: [ 0 for x in range(n_batch * n_output) ],
+}
+
+input0[input] = [1., 1.]
+input0[output_state_in] = [-0.423122, -0.0121822, 0.24201, -0.0812458]
+input0[cell_state_in] = [-0.978419, -0.139203, 0.338163, -0.0983904]
+output0[output] = [-0.358325, -0.04621704, 0.21641694, -0.06471302]
+
+Example((input0, output0))
diff --git a/nn/runtime/test/specs/lstm3.mod.py b/nn/runtime/test/specs/lstm3.mod.py
index 23e2b2e28..acfaa4cc5 100644
--- a/nn/runtime/test/specs/lstm3.mod.py
+++ b/nn/runtime/test/specs/lstm3.mod.py
@@ -56,8 +56,8 @@ cell_clip_param = Input("cell_clip_param", "TENSOR_FLOAT32", "{1}")
proj_clip_param = Input("proj_clip_param", "TENSOR_FLOAT32", "{1}")
scratch_buffer = IgnoredOutput("scratch_buffer", "TENSOR_FLOAT32", "{%d, %d}" % (n_batch, (n_cell * 4)))
-output_state_out = IgnoredOutput("output_state_out", "TENSOR_FLOAT32", "{%d, %d}" % (n_batch, n_output))
-cell_state_out = IgnoredOutput("cell_state_out", "TENSOR_FLOAT32", "{%d, %d}" % (n_batch, n_cell))
+output_state_out = Output("output_state_out", "TENSOR_FLOAT32", "{%d, %d}" % (n_batch, n_output))
+cell_state_out = Output("cell_state_out", "TENSOR_FLOAT32", "{%d, %d}" % (n_batch, n_cell))
output = Output("output", "TENSOR_FLOAT32", "{%d, %d}" % (n_batch, n_output))
# TODO: need support for more than one output
@@ -616,74 +616,51 @@ input0 = {input_to_input_weights: [
proj_clip_param: [0.],
}
-# Instantiate examples
-# TODO: Add more examples after fixing the reference issue
-test_inputs_batch0 = [
- # Batch0: 4 (input_sequence_size) * 5 (n_input)
- [0.787926, 0.151646, 0.071352, 0.118426, 0.458058],
-# [0.596268, 0.998386, 0.568695, 0.864524, 0.571277],
-# [0.073204, 0.296072, 0.743333, 0.069199, 0.045348],
-# [0.867394, 0.291279, 0.013714, 0.482521, 0.626339]
- ]
-
-test_inputs_batch1 = [
- # Batch1: 4 (input_sequence_size) * 5 (n_input)
- [0.295743, 0.544053, 0.690064, 0.858138, 0.497181],
-# [0.642421, 0.524260, 0.134799, 0.003639, 0.162482],
-# [0.640394, 0.930399, 0.050782, 0.432485, 0.988078],
-# [0.082922, 0.563329, 0.865614, 0.333232, 0.259916]
-]
-
-golden_outputs_batch0 = [
- # Batch0: 4 (input_sequence_size) * 16 (n_output)
- [-0.00396806, 0.029352, -0.00279226, 0.0159977, -0.00835576,
- -0.0211779, 0.0283512, -0.0114597, 0.00907307, -0.0244004,
- -0.0152191, -0.0259063, 0.00914318, 0.00415118, 0.017147,
- 0.0134203],
-# [-0.0166936, 0.0381209, 0.000889694, 0.0143363,
-# -0.0328911, -0.0234288, 0.0333051, -0.012229, 0.0110322,
-# -0.0457725, -0.000832209, -0.0202817, 0.0327257, 0.0121308,
-# 0.0155969, 0.0312091],
-# [-0.0213783, 0.0350169, 0.000324794,
-# 0.0276012, -0.0263374, -0.0371449, 0.0446149, -0.0205474,
-# 0.0103729, -0.0576349, -0.0150052, -0.0292043, 0.0376827,
-# 0.0136115, 0.0243435, 0.0354492],
-# [-0.0189322, 0.0464512,
-# -0.00251373, 0.0225745, -0.0308346, -0.0317124, 0.0460407,
-# -0.0189395, 0.0149363, -0.0530162, -0.0150767, -0.0340193,
-# 0.0286833, 0.00824207, 0.0264887, 0.0305169]
-]
-
-golden_outputs_batch1 = [
- # Batch1: 4 (input_sequence_size) * 16 (n_output)
+# Batch0: 4 (input_sequence_size) * 5 (n_input)
+input0[input] = [0.787926, 0.151646, 0.071352, 0.118426, 0.458058]
+# Batch1: 4 (input_sequence_size) * 5 (n_input)
+input0[input].extend(
+ [0.295743, 0.544053, 0.690064, 0.858138, 0.497181],
+)
+input0[cell_state_in] = [ 0 for _ in range(n_batch * n_cell) ]
+input0[output_state_in] = [ 0 for _ in range(n_batch * n_output) ]
+output0 = {
+ scratch_buffer: [ 0 for x in range(n_batch * n_cell * 4) ],
+ cell_state_out: [
+ -0.0531632, -0.0118138, 0.0870833, 0.0347929,
+ -0.076144, -0.0659219, -0.0463811, 0.0141307,
+ -0.0127706, -0.03782, -0.00402401, -0.00571876,
+ -0.187957, -0.0247127, 0.0711425, 0.008244,
+ 0.0492649, 0.126972, 0.0933097, 0.29848,
+ -0.0966178, -0.114417, 0.0387229, 0.0453255,
+ -0.181286, -0.0651251, -0.0996879, -0.00276995,
+ 0.0617558, -0.0100728, 0.056304, -0.077416,
+ -0.162858, -0.0541251, 0.0571202, -0.0525331,
+ 0.0724297, 0.171029, 0.141738, 0.295483,
+ ],
+ output_state_out: [
+ -0.00396806, 0.029352, -0.00279226, 0.0159977,
+ -0.00835577, -0.0211779, 0.0283512, -0.0114597,
+ 0.00907307, -0.0244004, -0.0152191, -0.0259063,
+ 0.00914318, 0.00415119, 0.017147, 0.0134203,
+ -0.013869, 0.0287268, -0.00334694, 0.00733397,
+ -0.0287926, -0.0186926, 0.0193662, -0.0115437,
+ 0.00422612, -0.0345232, 0.00223253, -0.00957321,
+ 0.0210624, 0.013331, 0.0150954, 0.0216801
+ ],
+}
+# Batch0: 4 (input_sequence_size) * 16 (n_output)
+output0[output] = [
+ -0.00396806, 0.029352, -0.00279226, 0.0159977, -0.00835576,
+ -0.0211779, 0.0283512, -0.0114597, 0.00907307, -0.0244004,
+ -0.0152191, -0.0259063, 0.00914318, 0.00415118, 0.017147,
+ 0.0134203]
+# Batch1: 4 (input_sequence_size) * 16 (n_output)
+output0[output].extend(
[-0.013869, 0.0287268, -0.00334693, 0.00733398, -0.0287926,
-0.0186926, 0.0193662, -0.0115437, 0.00422612, -0.0345232,
0.00223253, -0.00957321, 0.0210624, 0.013331, 0.0150954,
0.02168],
-# [-0.0141913, 0.0322082, 0.00227024, 0.0260507,
-# -0.0188721, -0.0296489, 0.0399134, -0.0160509, 0.0116039,
-# -0.0447318, -0.0150515, -0.0277406, 0.0316596, 0.0118233,
-# 0.0214762, 0.0293641],
-# [-0.0204549, 0.0450315, -0.00117378,
-# 0.0167673, -0.0375007, -0.0238314, 0.038784, -0.0174034,
-# 0.0131743, -0.0506589, -0.0048447, -0.0240239, 0.0325789,
-# 0.00790065, 0.0220157, 0.0333314],
-# [-0.0264787, 0.0387855,
-# -0.000764675, 0.0217599, -0.037537, -0.0335206, 0.0431679,
-# -0.0211424, 0.010203, -0.062785, -0.00832363, -0.025181,
-# 0.0412031, 0.0118723, 0.0239643, 0.0394009]
-]
-
-for (input_tensor0, input_tensor1, output_tensor0, output_tensor1) in zip(test_inputs_batch0, test_inputs_batch1, golden_outputs_batch0, golden_outputs_batch1):
- input_tensor0.extend(input_tensor1)
- input0[input] = input_tensor0
- input0[cell_state_in] = [ 0 for _ in range(n_batch * n_cell) ]
- input0[output_state_in] = [ 0 for _ in range(n_batch * n_output) ]
- output_tensor0.extend(output_tensor1)
- output0 = {
- scratch_buffer: [ 0 for x in range(n_batch * n_cell * 4) ],
- cell_state_out: [ 0 for x in range(n_batch * n_cell) ],
- output_state_out: [ 0 for x in range(n_batch * n_output) ],
- output: output_tensor0
- }
- Example((input0, output0))
+ )
+
+Example((input0, output0))
diff --git a/nn/runtime/test/specs/lstm3_state.mod.py b/nn/runtime/test/specs/lstm3_state.mod.py
new file mode 100644
index 000000000..46a1f8166
--- /dev/null
+++ b/nn/runtime/test/specs/lstm3_state.mod.py
@@ -0,0 +1,687 @@
+#
+# Copyright (C) 2017 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+# LSTM Test, With Peephole, With Projection, No Clipping
+
+model = Model()
+
+n_batch = 2
+n_input = 5
+# n_cell and n_output have the same size when there is no projection.
+n_cell = 20
+n_output = 16
+
+input = Input("input", "TENSOR_FLOAT32", "{%d, %d}" % (n_batch, n_input))
+
+input_to_input_weights = Input("input_to_input_weights", "TENSOR_FLOAT32", "{%d, %d}" % (n_cell, n_input))
+input_to_forget_weights = Input("input_to_forget_weights", "TENSOR_FLOAT32", "{%d, %d}" % (n_cell, n_input))
+input_to_cell_weights = Input("input_to_cell_weights", "TENSOR_FLOAT32", "{%d, %d}" % (n_cell, n_input))
+input_to_output_weights = Input("input_to_output_weights", "TENSOR_FLOAT32", "{%d, %d}" % (n_cell, n_input))
+
+recurrent_to_input_weights = Input("recurrent_to_intput_weights", "TENSOR_FLOAT32", "{%d, %d}" % (n_cell, n_output))
+recurrent_to_forget_weights = Input("recurrent_to_forget_weights", "TENSOR_FLOAT32", "{%d, %d}" % (n_cell, n_output))
+recurrent_to_cell_weights = Input("recurrent_to_cell_weights", "TENSOR_FLOAT32", "{%d, %d}" % (n_cell, n_output))
+recurrent_to_output_weights = Input("recurrent_to_output_weights", "TENSOR_FLOAT32", "{%d, %d}" % (n_cell, n_output))
+
+cell_to_input_weights = Input("cell_to_input_weights", "TENSOR_FLOAT32", "{%d}" % (n_cell))
+cell_to_forget_weights = Input("cell_to_forget_weights", "TENSOR_FLOAT32", "{%d}" %(n_cell))
+cell_to_output_weights = Input("cell_to_output_weights", "TENSOR_FLOAT32", "{%d}" % (n_cell))
+
+input_gate_bias = Input("input_gate_bias", "TENSOR_FLOAT32", "{%d}"%(n_cell))
+forget_gate_bias = Input("forget_gate_bias", "TENSOR_FLOAT32", "{%d}"%(n_cell))
+cell_gate_bias = Input("cell_gate_bias", "TENSOR_FLOAT32", "{%d}"%(n_cell))
+output_gate_bias = Input("output_gate_bias", "TENSOR_FLOAT32", "{%d}"%(n_cell))
+
+projection_weights = Input("projection_weights", "TENSOR_FLOAT32", "{%d,%d}" % (n_output, n_cell))
+projection_bias = Input("projection_bias", "TENSOR_FLOAT32", "{0}")
+
+output_state_in = Input("output_state_in", "TENSOR_FLOAT32", "{%d, %d}" % (n_batch, n_output))
+cell_state_in = Input("cell_state_in", "TENSOR_FLOAT32", "{%d, %d}" % (n_batch, n_cell))
+
+activation_param = Input("activation_param", "TENSOR_INT32", "{1}");
+cell_clip_param = Input("cell_clip_param", "TENSOR_FLOAT32", "{1}")
+proj_clip_param = Input("proj_clip_param", "TENSOR_FLOAT32", "{1}")
+
+scratch_buffer = IgnoredOutput("scratch_buffer", "TENSOR_FLOAT32", "{%d, %d}" % (n_batch, (n_cell * 4)))
+output_state_out = Output("output_state_out", "TENSOR_FLOAT32", "{%d, %d}" % (n_batch, n_output))
+cell_state_out = Output("cell_state_out", "TENSOR_FLOAT32", "{%d, %d}" % (n_batch, n_cell))
+output = Output("output", "TENSOR_FLOAT32", "{%d, %d}" % (n_batch, n_output))
+
+# TODO: need support for more than one output
+model = model.Operation("LSTM",
+ input,
+
+ input_to_input_weights,
+ input_to_forget_weights,
+ input_to_cell_weights,
+ input_to_output_weights,
+
+ recurrent_to_input_weights,
+ recurrent_to_forget_weights,
+ recurrent_to_cell_weights,
+ recurrent_to_output_weights,
+
+ cell_to_input_weights,
+ cell_to_forget_weights,
+ cell_to_output_weights,
+
+ input_gate_bias,
+ forget_gate_bias,
+ cell_gate_bias,
+ output_gate_bias,
+
+ projection_weights,
+ projection_bias,
+
+ output_state_in,
+ cell_state_in,
+
+ activation_param,
+ cell_clip_param,
+ proj_clip_param
+).To([scratch_buffer, output_state_out, cell_state_out, output])
+
+input0 = {input_to_input_weights: [
+ 0.021393683, 0.06124551, 0.046905167, -0.014657677, -0.03149463,
+ 0.09171803, 0.14647801, 0.10797193, -0.0057968358, 0.0019193048,
+ -0.2726754, 0.10154029, -0.018539885, 0.080349885, -0.10262385,
+ -0.022599787, -0.09121155, -0.008675967, -0.045206103, -0.0821282,
+ -0.008045952, 0.015478081, 0.055217247, 0.038719587, 0.044153627,
+ -0.06453243, 0.05031825, -0.046935108, -0.008164439, 0.014574226,
+ -0.1671009, -0.15519552, -0.16819797, -0.13971269, -0.11953059,
+ 0.25005487, -0.22790983, 0.009855087, -0.028140958, -0.11200698,
+ 0.11295408, -0.0035217577, 0.054485075, 0.05184695, 0.064711206,
+ 0.10989193, 0.11674786, 0.03490607, 0.07727357, 0.11390585,
+ -0.1863375, -0.1034451, -0.13945189, -0.049401227, -0.18767063,
+ 0.042483903, 0.14233552, 0.13832581, 0.18350165, 0.14545603,
+ -0.028545704, 0.024939531, 0.050929718, 0.0076203286, -0.0029723682,
+ -0.042484224, -0.11827596, -0.09171104, -0.10808628, -0.16327988,
+ -0.2273378, -0.0993647, -0.017155107, 0.0023917493, 0.049272764,
+ 0.0038534778, 0.054764505, 0.089753784, 0.06947234, 0.08014476,
+ -0.04544234, -0.0497073, -0.07135631, -0.048929106, -0.004042012,
+ -0.009284026, 0.018042054, 0.0036860977, -0.07427302, -0.11434604,
+ -0.018995456, 0.031487543, 0.012834908, 0.019977754, 0.044256654,
+ -0.39292613, -0.18519334, -0.11651281, -0.06809892, 0.011373677],
+
+ input_to_forget_weights: [
+ -0.0018401089, -0.004852237, 0.03698424, 0.014181704, 0.028273236,
+ -0.016726194, -0.05249759, -0.10204261, 0.00861066, -0.040979505,
+ -0.009899187, 0.01923892, -0.028177269, -0.08535103, -0.14585495,
+ 0.10662567, -0.01909731, -0.017883534, -0.0047269356, -0.045103323,
+ 0.0030784295, 0.076784775, 0.07463696, 0.094531395, 0.0814421,
+ -0.12257899, -0.033945758, -0.031303465, 0.045630626, 0.06843887,
+ -0.13492945, -0.012480007, -0.0811829, -0.07224499, -0.09628791,
+ 0.045100946, 0.0012300825, 0.013964662, 0.099372394, 0.02543059,
+ 0.06958324, 0.034257296, 0.0482646, 0.06267997, 0.052625068,
+ 0.12784666, 0.07077897, 0.025725935, 0.04165009, 0.07241905,
+ 0.018668644, -0.037377294, -0.06277783, -0.08833636, -0.040120605,
+ -0.011405586, -0.007808335, -0.010301386, -0.005102167, 0.027717464,
+ 0.05483423, 0.11449111, 0.11289652, 0.10939839, 0.13396506,
+ -0.08402166, -0.01901462, -0.044678304, -0.07720565, 0.014350063,
+ -0.11757958, -0.0652038, -0.08185733, -0.076754324, -0.092614375,
+ 0.10405491, 0.052960336, 0.035755895, 0.035839386, -0.012540553,
+ 0.036881298, 0.02913376, 0.03420159, 0.05448447, -0.054523353,
+ 0.02582715, 0.02327355, -0.011857179, -0.0011980024, -0.034641717,
+ -0.026125094, -0.17582615, -0.15923657, -0.27486774, -0.0006143371,
+ 0.0001771948, -8.470171e-05, 0.02651807, 0.045790765, 0.06956496],
+
+ input_to_cell_weights: [
+ -0.04580283, -0.09549462, -0.032418985, -0.06454633,
+ -0.043528453, 0.043018587, -0.049152344, -0.12418144,
+ -0.078985475, -0.07596889, 0.019484362, -0.11434962,
+ -0.0074034138, -0.06314844, -0.092981495, 0.0062155537,
+ -0.025034338, -0.0028890965, 0.048929527, 0.06235075,
+ 0.10665918, -0.032036792, -0.08505916, -0.10843358,
+ -0.13002433, -0.036816437, -0.02130134, -0.016518239,
+ 0.0047691227, -0.0025825808, 0.066017866, 0.029991534,
+ -0.10652836, -0.1037554, -0.13056071, -0.03266643,
+ -0.033702414, -0.006473424, -0.04611692, 0.014419339,
+ -0.025174323, 0.0396852, 0.081777506, 0.06157468,
+ 0.10210095, -0.009658194, 0.046511717, 0.03603906,
+ 0.0069369148, 0.015960095, -0.06507666, 0.09551598,
+ 0.053568836, 0.06408714, 0.12835667, -0.008714329,
+ -0.20211966, -0.12093674, 0.029450472, 0.2849013,
+ -0.029227901, 0.1164364, -0.08560263, 0.09941786,
+ -0.036999565, -0.028842626, -0.0033637602, -0.017012902,
+ -0.09720865, -0.11193351, -0.029155117, -0.017936034,
+ -0.009768936, -0.04223324, -0.036159635, 0.06505112,
+ -0.021742892, -0.023377212, -0.07221364, -0.06430552,
+ 0.05453865, 0.091149814, 0.06387331, 0.007518393,
+ 0.055960953, 0.069779344, 0.046411168, 0.10509911,
+ 0.07463894, 0.0075130584, 0.012850982, 0.04555431,
+ 0.056955688, 0.06555285, 0.050801456, -0.009862683,
+ 0.00826772, -0.026555609, -0.0073611983, -0.0014897042],
+
+ input_to_output_weights: [
+ -0.0998932, -0.07201956, -0.052803773, -0.15629593, -0.15001918,
+ -0.07650751, 0.02359855, -0.075155355, -0.08037709, -0.15093534,
+ 0.029517552, -0.04751393, 0.010350531, -0.02664851, -0.016839722,
+ -0.023121163, 0.0077019283, 0.012851257, -0.05040649, -0.0129761,
+ -0.021737747, -0.038305793, -0.06870586, -0.01481247, -0.001285394,
+ 0.10124236, 0.083122835, 0.053313006, -0.062235646, -0.075637154,
+ -0.027833903, 0.029774971, 0.1130802, 0.09218906, 0.09506135,
+ -0.086665764, -0.037162706, -0.038880914, -0.035832845, -0.014481564,
+ -0.09825003, -0.12048569, -0.097665586, -0.05287633, -0.0964047,
+ -0.11366429, 0.035777505, 0.13568819, 0.052451383, 0.050649304,
+ 0.05798951, -0.021852335, -0.099848844, 0.014740475, -0.078897946,
+ 0.04974699, 0.014160473, 0.06973932, 0.04964942, 0.033364646,
+ 0.08190124, 0.025535367, 0.050893165, 0.048514254, 0.06945813,
+ -0.078907564, -0.06707616, -0.11844508, -0.09986688, -0.07509403,
+ 0.06263226, 0.14925587, 0.20188436, 0.12098451, 0.14639415,
+ 0.0015017595, -0.014267382, -0.03417257, 0.012711468, 0.0028300495,
+ -0.024758482, -0.05098548, -0.0821182, 0.014225672, 0.021544158,
+ 0.08949725, 0.07505268, -0.0020780868, 0.04908258, 0.06476295,
+ -0.022907063, 0.027562456, 0.040185735, 0.019567577, -0.015598739,
+ -0.049097303, -0.017121866, -0.083368234, -0.02332002, -0.0840956],
+
+ input_gate_bias: [
+ 0.02234832, 0.14757581, 0.18176508, 0.10380666, 0.053110216,
+ -0.06928846, -0.13942584, -0.11816189, 0.19483899, 0.03652339,
+ -0.10250295, 0.036714908, -0.18426876, 0.036065217, 0.21810818,
+ 0.02383196, -0.043370757, 0.08690144, -0.04444982, 0.00030581196],
+
+ forget_gate_bias: [
+ 0.035185695, -0.042891346, -0.03032477, 0.23027696,
+ 0.11098921, 0.15378423, 0.09263801, 0.09790885,
+ 0.09508917, 0.061199076, 0.07665568, -0.015443159,
+ -0.03499149, 0.046190713, 0.08895977, 0.10899629,
+ 0.40694186, 0.06030037, 0.012413437, -0.06108739],
+
+ cell_gate_bias: [
+ -0.024379363, 0.0055531194, 0.23377132, 0.033463873,
+ -0.1483596, -0.10639995, -0.091433935, 0.058573797,
+ -0.06809782, -0.07889636, -0.043246906, -0.09829136,
+ -0.4279842, 0.034901652, 0.18797937, 0.0075234566,
+ 0.016178843, 0.1749513, 0.13975595, 0.92058027],
+
+ output_gate_bias: [
+ 0.046159424, -0.0012809046, 0.03563469, 0.12648113, 0.027195795,
+ 0.35373217, -0.018957434, 0.008907322, -0.0762701, 0.12018895,
+ 0.04216877, 0.0022856654, 0.040952638, 0.3147856, 0.08225149,
+ -0.057416286, -0.14995944, -0.008040261, 0.13208859, 0.029760877],
+
+ recurrent_to_input_weights: [
+ -0.001374326, -0.078856036, 0.10672688, 0.029162422,
+ -0.11585556, 0.02557986, -0.13446963, -0.035785314,
+ -0.01244275, 0.025961924, -0.02337298, -0.044228926,
+ -0.055839065, -0.046598054, -0.010546039, -0.06900766,
+ 0.027239809, 0.022582639, -0.013296484, -0.05459212,
+ 0.08981, -0.045407712, 0.08682226, -0.06867011,
+ -0.14390695, -0.02916037, 0.000996957, 0.091420636,
+ 0.14283475, -0.07390571, -0.06402044, 0.062524505,
+ -0.093129106, 0.04860203, -0.08364217, -0.08119002,
+ 0.009352075, 0.22920375, 0.0016303885, 0.11583097,
+ -0.13732095, 0.012405723, -0.07551853, 0.06343048,
+ 0.12162708, -0.031923793, -0.014335606, 0.01790974,
+ -0.10650317, -0.0724401, 0.08554849, -0.05727212,
+ 0.06556731, -0.042729504, -0.043227166, 0.011683251,
+ -0.013082158, -0.029302018, -0.010899579, -0.062036745,
+ -0.022509435, -0.00964907, -0.01567329, 0.04260106,
+ -0.07787477, -0.11576462, 0.017356863, 0.048673786,
+ -0.017577527, -0.05527947, -0.082487635, -0.040137455,
+ -0.10820036, -0.04666372, 0.022746278, -0.07851417,
+ 0.01068115, 0.032956902, 0.022433773, 0.0026891115,
+ 0.08944216, -0.0685835, 0.010513544, 0.07228705,
+ 0.02032331, -0.059686817, -0.0005566496, -0.086984694,
+ 0.040414046, -0.1380399, 0.094208956, -0.05722982,
+ 0.012092817, -0.04989123, -0.086576, -0.003399834,
+ -0.04696032, -0.045747425, 0.10091314, 0.048676282,
+ -0.029037097, 0.031399418, -0.0040285117, 0.047237843,
+ 0.09504992, 0.041799378, -0.049185462, -0.031518843,
+ -0.10516937, 0.026374253, 0.10058866, -0.0033195973,
+ -0.041975245, 0.0073591834, 0.0033782164, -0.004325073,
+ -0.10167381, 0.042500053, -0.01447153, 0.06464186,
+ -0.017142897, 0.03312627, 0.009205989, 0.024138335,
+ -0.011337001, 0.035530265, -0.010912711, 0.0706555,
+ -0.005894094, 0.051841937, -0.1401738, -0.02351249,
+ 0.0365468, 0.07590991, 0.08838724, 0.021681072,
+ -0.10086113, 0.019608743, -0.06195883, 0.077335775,
+ 0.023646897, -0.095322326, 0.02233014, 0.09756986,
+ -0.048691444, -0.009579111, 0.07595467, 0.11480546,
+ -0.09801813, 0.019894179, 0.08502348, 0.004032281,
+ 0.037211012, 0.068537936, -0.048005626, -0.091520436,
+ -0.028379958, -0.01556313, 0.06554592, -0.045599163,
+ -0.01672207, -0.020169014, -0.011877351, -0.20212261,
+ 0.010889619, 0.0047078193, 0.038385306, 0.08540671,
+ -0.017140968, -0.0035865551, 0.016678626, 0.005633034,
+ 0.015963363, 0.00871737, 0.060130805, 0.028611384,
+ 0.10109069, -0.015060172, -0.07894427, 0.06401885,
+ 0.011584063, -0.024466386, 0.0047652307, -0.09041358,
+ 0.030737216, -0.0046374933, 0.14215417, -0.11823516,
+ 0.019899689, 0.006106124, -0.027092824, 0.0786356,
+ 0.05052217, -0.058925, -0.011402121, -0.024987547,
+ -0.0013661642, -0.06832946, -0.015667673, -0.1083353,
+ -0.00096863037, -0.06988685, -0.053350925, -0.027275559,
+ -0.033664223, -0.07978348, -0.025200296, -0.017207067,
+ -0.058403496, -0.055697463, 0.005798788, 0.12965427,
+ -0.062582195, 0.0013350133, -0.10482091, 0.0379771,
+ 0.072521195, -0.0029455067, -0.13797039, -0.03628521,
+ 0.013806405, -0.017858358, -0.01008298, -0.07700066,
+ -0.017081132, 0.019358726, 0.0027079724, 0.004635139,
+ 0.062634714, -0.02338735, -0.039547626, -0.02050681,
+ 0.03385117, -0.083611414, 0.002862572, -0.09421313,
+ 0.058618143, -0.08598433, 0.00972939, 0.023867095,
+ -0.053934585, -0.023203006, 0.07452513, -0.048767887,
+ -0.07314807, -0.056307215, -0.10433547, -0.06440842,
+ 0.04328182, 0.04389765, -0.020006588, -0.09076438,
+ -0.11652589, -0.021705797, 0.03345259, -0.010329105,
+ -0.025767034, 0.013057034, -0.07316461, -0.10145612,
+ 0.06358255, 0.18531723, 0.07759293, 0.12006465,
+ 0.1305557, 0.058638252, -0.03393652, 0.09622831,
+ -0.16253184, -2.4580743e-06, 0.079869635, -0.070196845,
+ -0.005644518, 0.06857898, -0.12598175, -0.035084512,
+ 0.03156317, -0.12794146, -0.031963028, 0.04692781,
+ 0.030070418, 0.0071660685, -0.095516115, -0.004643372,
+ 0.040170413, -0.062104587, -0.0037324072, 0.0554317,
+ 0.08184801, -0.019164372, 0.06791302, 0.034257166,
+ -0.10307039, 0.021943003, 0.046745934, 0.0790918,
+ -0.0265588, -0.007824208, 0.042546265, -0.00977924,
+ -0.0002440307, -0.017384544, -0.017990116, 0.12252321,
+ -0.014512694, -0.08251313, 0.08861942, 0.13589665,
+ 0.026351685, 0.012641483, 0.07466548, 0.044301085,
+ -0.045414884, -0.051112458, 0.03444247, -0.08502782,
+ -0.04106223, -0.028126027, 0.028473156, 0.10467447],
+
+ recurrent_to_forget_weights: [
+ -0.057784554, -0.026057621, -0.068447545, -0.022581743,
+ 0.14811787, 0.10826372, 0.09471067, 0.03987225,
+ -0.0039523416, 0.00030638507, 0.053185795, 0.10572994,
+ 0.08414449, -0.022036452, -0.00066928595, -0.09203576,
+ 0.032950465, -0.10985798, -0.023809856, 0.0021431844,
+ -0.02196096, -0.00326074, 0.00058621005, -0.074678116,
+ -0.06193199, 0.055729095, 0.03736828, 0.020123724,
+ 0.061878487, -0.04729229, 0.034919553, -0.07585433,
+ -0.04421272, -0.044019096, 0.085488975, 0.04058006,
+ -0.06890133, -0.030951202, -0.024628663, -0.07672815,
+ 0.034293607, 0.08556707, -0.05293577, -0.033561368,
+ -0.04899627, 0.0241671, 0.015736353, -0.095442444,
+ -0.029564252, 0.016493602, -0.035026584, 0.022337519,
+ -0.026871363, 0.004780428, 0.0077918363, -0.03601621,
+ 0.016435321, -0.03263031, -0.09543275, -0.047392778,
+ 0.013454138, 0.028934088, 0.01685226, -0.086110644,
+ -0.046250615, -0.01847454, 0.047608484, 0.07339695,
+ 0.034546845, -0.04881143, 0.009128804, -0.08802852,
+ 0.03761666, 0.008096139, -0.014454086, 0.014361001,
+ -0.023502491, -0.0011840804, -0.07607001, 0.001856849,
+ -0.06509276, -0.006021153, -0.08570962, -0.1451793,
+ 0.060212336, 0.055259194, 0.06974018, 0.049454916,
+ -0.027794661, -0.08077226, -0.016179763, 0.1169753,
+ 0.17213494, -0.0056326236, -0.053934924, -0.0124349,
+ -0.11520337, 0.05409887, 0.088759385, 0.0019655675,
+ 0.0042065294, 0.03881498, 0.019844765, 0.041858196,
+ -0.05695512, 0.047233116, 0.038937137, -0.06542224,
+ 0.014429736, -0.09719407, 0.13908425, -0.05379757,
+ 0.012321099, 0.082840554, -0.029899208, 0.044217527,
+ 0.059855383, 0.07711018, -0.045319796, 0.0948846,
+ -0.011724666, -0.0033288454, -0.033542685, -0.04764985,
+ -0.13873616, 0.040668588, 0.034832682, -0.015319203,
+ -0.018715994, 0.046002675, 0.0599172, -0.043107376,
+ 0.0294216, -0.002314414, -0.022424703, 0.0030315618,
+ 0.0014641669, 0.0029166266, -0.11878115, 0.013738511,
+ 0.12375372, -0.0006038222, 0.029104086, 0.087442465,
+ 0.052958444, 0.07558703, 0.04817258, 0.044462286,
+ -0.015213451, -0.08783778, -0.0561384, -0.003008196,
+ 0.047060397, -0.002058388, 0.03429439, -0.018839769,
+ 0.024734668, 0.024614193, -0.042046934, 0.09597743,
+ -0.0043254104, 0.04320769, 0.0064070094, -0.0019131786,
+ -0.02558259, -0.022822596, -0.023273505, -0.02464396,
+ -0.10991725, -0.006240552, 0.0074488563, 0.024044557,
+ 0.04383914, -0.046476185, 0.028658995, 0.060410924,
+ 0.050786525, 0.009452605, -0.0073054377, -0.024810238,
+ 0.0052906186, 0.0066939713, -0.0020913032, 0.014515517,
+ 0.015898481, 0.021362653, -0.030262267, 0.016587038,
+ -0.011442813, 0.041154444, -0.007631438, -0.03423484,
+ -0.010977775, 0.036152758, 0.0066366293, 0.11915515,
+ 0.02318443, -0.041350313, 0.021485701, -0.10906167,
+ -0.028218046, -0.00954771, 0.020531068, -0.11995105,
+ -0.03672871, 0.024019798, 0.014255957, -0.05221243,
+ -0.00661567, -0.04630967, 0.033188973, 0.10107534,
+ -0.014027541, 0.030796422, -0.10270911, -0.035999842,
+ 0.15443139, 0.07684145, 0.036571592, -0.035900835,
+ -0.0034699554, 0.06209149, 0.015920248, -0.031122351,
+ -0.03858649, 0.01849943, 0.13872518, 0.01503974,
+ 0.069941424, -0.06948533, -0.0088794185, 0.061282158,
+ -0.047401894, 0.03100163, -0.041533746, -0.10430945,
+ 0.044574402, -0.01425562, -0.024290353, 0.034563623,
+ 0.05866852, 0.023947537, -0.09445152, 0.035450947,
+ 0.02247216, -0.0042998926, 0.061146557, -0.10250651,
+ 0.020881841, -0.06747029, 0.10062043, -0.0023941975,
+ 0.03532124, -0.016341697, 0.09685456, -0.016764693,
+ 0.051808182, 0.05875331, -0.04536488, 0.001626336,
+ -0.028892258, -0.01048663, -0.009793449, -0.017093895,
+ 0.010987891, 0.02357273, -0.00010856845, 0.0099760275,
+ -0.001845119, -0.03551521, 0.0018358806, 0.05763657,
+ -0.01769146, 0.040995963, 0.02235177, -0.060430344,
+ 0.11475477, -0.023854522, 0.10071741, 0.0686208,
+ -0.014250481, 0.034261297, 0.047418304, 0.08562733,
+ -0.030519066, 0.0060542435, 0.014653856, -0.038836084,
+ 0.04096551, 0.032249358, -0.08355519, -0.026823482,
+ 0.056386515, -0.010401743, -0.028396193, 0.08507674,
+ 0.014410365, 0.020995233, 0.17040324, 0.11511526,
+ 0.02459721, 0.0066619175, 0.025853224, -0.023133837,
+ -0.081302024, 0.017264642, -0.009585969, 0.09491168,
+ -0.051313367, 0.054532815, -0.014298593, 0.10657464,
+ 0.007076659, 0.10964551, 0.0409152, 0.008275321,
+ -0.07283536, 0.07937492, 0.04192024, -0.1075027],
+
+ recurrent_to_cell_weights: [
+ -0.037322544, 0.018592842, 0.0056175636, -0.06253426,
+ 0.055647098, -0.05713207, -0.05626563, 0.005559383,
+ 0.03375411, -0.025757805, -0.088049285, 0.06017052,
+ -0.06570978, 0.007384076, 0.035123326, -0.07920549,
+ 0.053676967, 0.044480428, -0.07663568, 0.0071805613,
+ 0.08089997, 0.05143358, 0.038261272, 0.03339287,
+ -0.027673481, 0.044746667, 0.028349208, 0.020090483,
+ -0.019443132, -0.030755889, -0.0040000007, 0.04465846,
+ -0.021585021, 0.0031670958, 0.0053199246, -0.056117613,
+ -0.10893326, 0.076739706, -0.08509834, -0.027997585,
+ 0.037871376, 0.01449768, -0.09002357, -0.06111149,
+ -0.046195522, 0.0422062, -0.005683705, -0.1253618,
+ -0.012925729, -0.04890792, 0.06985068, 0.037654128,
+ 0.03398274, -0.004781977, 0.007032333, -0.031787455,
+ 0.010868644, -0.031489216, 0.09525667, 0.013939797,
+ 0.0058680447, 0.0167067, 0.02668468, -0.04797466,
+ -0.048885044, -0.12722108, 0.035304096, 0.06554885,
+ 0.00972396, -0.039238118, -0.05159735, -0.11329045,
+ 0.1613692, -0.03750952, 0.06529313, -0.071974665,
+ -0.11769596, 0.015524369, -0.0013754242, -0.12446318,
+ 0.02786344, -0.014179351, 0.005264273, 0.14376344,
+ 0.015983658, 0.03406988, -0.06939408, 0.040699873,
+ 0.02111075, 0.09669095, 0.041345075, -0.08316494,
+ -0.07684199, -0.045768797, 0.032298047, -0.041805092,
+ 0.0119405, 0.0061010392, 0.12652606, 0.0064572375,
+ -0.024950314, 0.11574242, 0.04508852, -0.04335324,
+ 0.06760663, -0.027437469, 0.07216407, 0.06977076,
+ -0.05438599, 0.034033038, -0.028602652, 0.05346137,
+ 0.043184172, -0.037189785, 0.10420091, 0.00882477,
+ -0.054019816, -0.074273005, -0.030617684, -0.0028467078,
+ 0.024302477, -0.0038869337, 0.005332455, 0.0013399826,
+ 0.04361412, -0.007001822, 0.09631092, -0.06702025,
+ -0.042049985, -0.035070654, -0.04103342, -0.10273396,
+ 0.0544271, 0.037184782, -0.13150354, -0.0058036847,
+ -0.008264958, 0.042035464, 0.05891794, 0.029673764,
+ 0.0063542654, 0.044788733, 0.054816857, 0.062257513,
+ -0.00093483756, 0.048938446, -0.004952862, -0.007730018,
+ -0.04043371, -0.017094059, 0.07229206, -0.023670016,
+ -0.052195564, -0.025616996, -0.01520939, 0.045104615,
+ -0.007376126, 0.003533447, 0.006570588, 0.056037236,
+ 0.12436656, 0.051817212, 0.028532185, -0.08686856,
+ 0.11868599, 0.07663395, -0.07323171, 0.03463402,
+ -0.050708205, -0.04458982, -0.11590894, 0.021273347,
+ 0.1251325, -0.15313013, -0.12224372, 0.17228661,
+ 0.023029093, 0.086124025, 0.006445803, -0.03496501,
+ 0.028332196, 0.04449512, -0.042436164, -0.026587414,
+ -0.006041347, -0.09292539, -0.05678812, 0.03897832,
+ 0.09465633, 0.008115513, -0.02171956, 0.08304309,
+ 0.071401566, 0.019622514, 0.032163795, -0.004167056,
+ 0.02295182, 0.030739572, 0.056506045, 0.004612461,
+ 0.06524936, 0.059999723, 0.046395954, -0.0045512207,
+ -0.1335546, -0.030136576, 0.11584653, -0.014678886,
+ 0.0020118146, -0.09688814, -0.0790206, 0.039770417,
+ -0.0329582, 0.07922767, 0.029322514, 0.026405897,
+ 0.04207835, -0.07073373, 0.063781224, 0.0859677,
+ -0.10925287, -0.07011058, 0.048005477, 0.03438226,
+ -0.09606514, -0.006669445, -0.043381985, 0.04240257,
+ -0.06955775, -0.06769346, 0.043903265, -0.026784198,
+ -0.017840602, 0.024307009, -0.040079936, -0.019946516,
+ 0.045318738, -0.12233574, 0.026170589, 0.0074471775,
+ 0.15978073, 0.10185836, 0.10298046, -0.015476589,
+ -0.039390966, -0.072174534, 0.0739445, -0.1211869,
+ -0.0347889, -0.07943156, 0.014809798, -0.12412325,
+ -0.0030663363, 0.039695457, 0.0647603, -0.08291318,
+ -0.018529687, -0.004423833, 0.0037507233, 0.084633216,
+ -0.01514876, -0.056505352, -0.012800942, -0.06994386,
+ 0.012962922, -0.031234352, 0.07029052, 0.016418684,
+ 0.03618972, 0.055686004, -0.08663945, -0.017404709,
+ -0.054761406, 0.029065743, 0.052404847, 0.020238016,
+ 0.0048197987, -0.0214882, 0.07078733, 0.013016777,
+ 0.06262858, 0.009184685, 0.020785125, -0.043904778,
+ -0.0270329, -0.03299152, -0.060088247, -0.015162964,
+ -0.001828936, 0.12642565, -0.056757294, 0.013586685,
+ 0.09232601, -0.035886683, 0.06000002, 0.05229691,
+ -0.052580316, -0.082029596, -0.010794592, 0.012947712,
+ -0.036429964, -0.085508935, -0.13127148, -0.017744139,
+ 0.031502828, 0.036232427, -0.031581745, 0.023051167,
+ -0.05325106, -0.03421577, 0.028793324, -0.034633752,
+ -0.009881397, -0.043551125, -0.018609839, 0.0019097115,
+ -0.008799762, 0.056595087, 0.0022273948, 0.055752404],
+
+ recurrent_to_output_weights: [
+ 0.025825322, -0.05813119, 0.09495884, -0.045984812, -0.01255415,
+ -0.0026479573, -0.08196161, -0.054914974, -0.0046604523, -0.029587349,
+ -0.044576716, -0.07480124, -0.082868785, 0.023254942, 0.027502948,
+ -0.0039728214, -0.08683098, -0.08116779, -0.014675607, -0.037924774,
+ -0.023314456, -0.007401714, -0.09255757, 0.029460307, -0.08829125,
+ -0.005139627, -0.08989442, -0.0555066, 0.13596267, -0.025062224,
+ -0.048351806, -0.03850004, 0.07266485, -0.022414139, 0.05940088,
+ 0.075114764, 0.09597592, -0.010211725, -0.0049794707, -0.011523867,
+ -0.025980417, 0.072999895, 0.11091378, -0.081685916, 0.014416728,
+ 0.043229222, 0.034178585, -0.07530371, 0.035837382, -0.085607,
+ -0.007721233, -0.03287832, -0.043848954, -0.06404588, -0.06632928,
+ -0.073643476, 0.008214239, -0.045984086, 0.039764922, 0.03474462,
+ 0.060612556, -0.080590084, 0.049127717, 0.04151091, -0.030063879,
+ 0.008801774, -0.023021035, -0.019558564, 0.05158114, -0.010947698,
+ -0.011825728, 0.0075720972, 0.0699727, -0.0039981045, 0.069350146,
+ 0.08799282, 0.016156472, 0.035502106, 0.11695009, 0.006217345,
+ 0.13392477, -0.037875112, 0.025745004, 0.08940699, -0.00924166,
+ 0.0046702605, -0.036598757, -0.08811812, 0.10522024, -0.032441203,
+ 0.008176899, -0.04454919, 0.07058152, 0.0067963637, 0.039206743,
+ 0.03259838, 0.03725492, -0.09515802, 0.013326398, -0.052055415,
+ -0.025676316, 0.03198509, -0.015951829, -0.058556724, 0.036879618,
+ 0.043357447, 0.028362012, -0.05908629, 0.0059240665, -0.04995891,
+ -0.019187413, 0.0276265, -0.01628143, 0.0025863599, 0.08800015,
+ 0.035250366, -0.022165963, -0.07328642, -0.009415526, -0.07455109,
+ 0.11690406, 0.0363299, 0.07411125, 0.042103454, -0.009660886,
+ 0.019076364, 0.018299393, -0.046004917, 0.08891175, 0.0431396,
+ -0.026327137, -0.051502608, 0.08979574, -0.051670972, 0.04940282,
+ -0.07491107, -0.021240504, 0.022596184, -0.034280192, 0.060163025,
+ -0.058211457, -0.051837247, -0.01349775, -0.04639988, -0.035936575,
+ -0.011681591, 0.064818054, 0.0073146066, -0.021745546, -0.043124277,
+ -0.06471268, -0.07053354, -0.029321948, -0.05330136, 0.016933719,
+ -0.053782392, 0.13747959, -0.1361751, -0.11569455, 0.0033329215,
+ 0.05693899, -0.053219706, 0.063698, 0.07977434, -0.07924483,
+ 0.06936997, 0.0034815092, -0.007305279, -0.037325785, -0.07251102,
+ -0.033633437, -0.08677009, 0.091591336, -0.14165086, 0.021752775,
+ 0.019683983, 0.0011612234, -0.058154266, 0.049996935, 0.0288841,
+ -0.0024567875, -0.14345716, 0.010955264, -0.10234828, 0.1183656,
+ -0.0010731248, -0.023590032, -0.072285876, -0.0724771, -0.026382286,
+ -0.0014920527, 0.042667855, 0.0018776858, 0.02986552, 0.009814309,
+ 0.0733756, 0.12289186, 0.018043943, -0.0458958, 0.049412545,
+ 0.033632483, 0.05495232, 0.036686596, -0.013781798, -0.010036754,
+ 0.02576849, -0.08307328, 0.010112348, 0.042521734, -0.05869831,
+ -0.071689695, 0.03876447, -0.13275425, -0.0352966, -0.023077697,
+ 0.10285965, 0.084736146, 0.15568255, -0.00040734606, 0.027835453,
+ -0.10292561, -0.032401145, 0.10053256, -0.026142767, -0.08271222,
+ -0.0030240538, -0.016368777, 0.1070414, 0.042672627, 0.013456989,
+ -0.0437609, -0.022309763, 0.11576483, 0.04108048, 0.061026827,
+ -0.0190714, -0.0869359, 0.037901703, 0.0610107, 0.07202949,
+ 0.01675338, 0.086139716, -0.08795751, -0.014898893, -0.023771819,
+ -0.01965048, 0.007955471, -0.043740474, 0.03346837, -0.10549954,
+ 0.090567775, 0.042013682, -0.03176985, 0.12569028, -0.02421228,
+ -0.029526481, 0.023851605, 0.031539805, 0.05292009, -0.02344001,
+ -0.07811758, -0.08834428, 0.10094801, 0.16594367, -0.06861939,
+ -0.021256343, -0.041093912, -0.06669611, 0.035498552, 0.021757556,
+ -0.09302526, -0.015403468, -0.06614931, -0.051798206, -0.013874718,
+ 0.03630673, 0.010412845, -0.08077351, 0.046185967, 0.0035662893,
+ 0.03541868, -0.094149634, -0.034814864, 0.003128424, -0.020674974,
+ -0.03944324, -0.008110165, -0.11113267, 0.08484226, 0.043586485,
+ 0.040582247, 0.0968012, -0.065249965, -0.028036479, 0.0050708856,
+ 0.0017462453, 0.0326779, 0.041296225, 0.09164146, -0.047743853,
+ -0.015952192, -0.034451712, 0.084197424, -0.05347844, -0.11768019,
+ 0.085926116, -0.08251791, -0.045081906, 0.0948852, 0.068401024,
+ 0.024856757, 0.06978981, -0.057309967, -0.012775832, -0.0032452994,
+ 0.01977615, -0.041040014, -0.024264973, 0.063464895, 0.05431621],
+
+ cell_to_input_weights: [
+ 0.040369894, 0.030746894, 0.24704495, 0.018586371, -0.037586458,
+ -0.15312155, -0.11812848, -0.11465643, 0.20259799, 0.11418174,
+ -0.10116027, -0.011334949, 0.12411352, -0.076769054, -0.052169047,
+ 0.21198851, -0.38871562, -0.09061183, -0.09683246, -0.21929175],
+
+ cell_to_forget_weights: [
+ -0.01998659, -0.15568835, -0.24248174, -0.012770197, 0.041331276,
+ -0.072311886, -0.052123554, -0.0066330447, -0.043891653, 0.036225766,
+ -0.047248036, 0.021479502, 0.033189066, 0.11952997, -0.020432774,
+ 0.64658105, -0.06650122, -0.03467612, 0.095340036, 0.23647355],
+
+ cell_to_output_weights: [
+ 0.08286371, -0.08261836, -0.51210177, 0.002913762, 0.17764764,
+ -0.5495371, -0.08460716, -0.24552552, 0.030037103, 0.04123544,
+ -0.11940523, 0.007358328, 0.1890978, 0.4833202, -0.34441817,
+ 0.36312827, -0.26375428, 0.1457655, -0.19724406, 0.15548733],
+
+ projection_weights: [
+ -0.009802181, 0.09401916, 0.0717386, -0.13895074, 0.09641832,
+ 0.060420845, 0.08539281, 0.054285463, 0.061395317, 0.034448683,
+ -0.042991187, 0.019801661, -0.16840284, -0.015726732, -0.23041931,
+ -0.024478018, -0.10959692, -0.013875541, 0.18600968, -0.061274476,
+ 0.0138165, -0.08160894, -0.07661644, 0.032372914, 0.16169067,
+ 0.22465782, -0.03993472, -0.004017731, 0.08633481, -0.28869787,
+ 0.08682067, 0.17240396, 0.014975425, 0.056431185, 0.031037588,
+ 0.16702051, 0.0077946745, 0.15140012, 0.29405436, 0.120285,
+ -0.188994, -0.027265169, 0.043389652, -0.022061434, 0.014777949,
+ -0.20203483, 0.094781205, 0.19100232, 0.13987629, -0.036132768,
+ -0.06426278, -0.05108664, 0.13221376, 0.009441198, -0.16715929,
+ 0.15859416, -0.040437475, 0.050779544, -0.022187516, 0.012166504,
+ 0.027685808, -0.07675938, -0.0055694645, -0.09444123, 0.0046453946,
+ 0.050794356, 0.10770313, -0.20790008, -0.07149004, -0.11425117,
+ 0.008225835, -0.035802525, 0.14374903, 0.15262283, 0.048710253,
+ 0.1847461, -0.007487823, 0.11000021, -0.09542012, 0.22619456,
+ -0.029149994, 0.08527916, 0.009043713, 0.0042746216, 0.016261552,
+ 0.022461696, 0.12689082, -0.043589946, -0.12035478, -0.08361797,
+ -0.050666027, -0.1248618, -0.1275799, -0.071875185, 0.07377272,
+ 0.09944291, -0.18897448, -0.1593054, -0.06526116, -0.040107165,
+ -0.004618631, -0.067624845, -0.007576253, 0.10727444, 0.041546922,
+ -0.20424393, 0.06907816, 0.050412357, 0.00724631, 0.039827548,
+ 0.12449835, 0.10747581, 0.13708383, 0.09134148, -0.12617786,
+ -0.06428341, 0.09956831, 0.1208086, -0.14676677, -0.0727722,
+ 0.1126304, 0.010139365, 0.015571211, -0.038128063, 0.022913318,
+ -0.042050496, 0.16842307, -0.060597885, 0.10531834, -0.06411776,
+ -0.07451711, -0.03410368, -0.13393489, 0.06534304, 0.003620307,
+ 0.04490757, 0.05970546, 0.05197996, 0.02839995, 0.10434969,
+ -0.013699693, -0.028353551, -0.07260381, 0.047201227, -0.024575593,
+ -0.036445823, 0.07155557, 0.009672501, -0.02328883, 0.009533515,
+ -0.03606021, -0.07421458, -0.028082801, -0.2678904, -0.13221288,
+ 0.18419984, -0.13012612, -0.014588381, -0.035059117, -0.04824723,
+ 0.07830115, -0.056184657, 0.03277091, 0.025466874, 0.14494097,
+ -0.12522776, -0.098633975, -0.10766018, -0.08317623, 0.08594209,
+ 0.07749552, 0.039474737, 0.1776665, -0.07409566, -0.0477268,
+ 0.29323658, 0.10801441, 0.1154011, 0.013952499, 0.10739139,
+ 0.10708251, -0.051456142, 0.0074137426, -0.10430189, 0.10034707,
+ 0.045594677, 0.0635285, -0.0715442, -0.089667566, -0.10811871,
+ 0.00026344223, 0.08298446, -0.009525053, 0.006585689, -0.24567553,
+ -0.09450807, 0.09648481, 0.026996298, -0.06419476, -0.04752702,
+ -0.11063944, -0.23441927, -0.17608605, -0.052156363, 0.067035615,
+ 0.19271925, -0.0032889997, -0.043264326, 0.09663576, -0.057112187,
+ -0.10100678, 0.0628376, 0.04447668, 0.017961001, -0.10094388,
+ -0.10190601, 0.18335468, 0.10494553, -0.052095775, -0.0026118709,
+ 0.10539724, -0.04383912, -0.042349473, 0.08438151, -0.1947263,
+ 0.02251204, 0.11216432, -0.10307853, 0.17351969, -0.039091777,
+ 0.08066188, -0.00561982, 0.12633002, 0.11335965, -0.0088127935,
+ -0.019777594, 0.06864014, -0.059751723, 0.016233567, -0.06894641,
+ -0.28651384, -0.004228674, 0.019708522, -0.16305895, -0.07468996,
+ -0.0855457, 0.099339016, -0.07580735, -0.13775392, 0.08434318,
+ 0.08330512, -0.12131499, 0.031935584, 0.09180414, -0.08876437,
+ -0.08049874, 0.008753825, 0.03498998, 0.030215185, 0.03907079,
+ 0.089751154, 0.029194152, -0.03337423, -0.019092513, 0.04331237,
+ 0.04299654, -0.036394123, -0.12915532, 0.09793732, 0.07512415,
+ -0.11319543, -0.032502122, 0.15661901, 0.07671967, -0.005491124,
+ -0.19379048, -0.218606, 0.21448623, 0.017840758, 0.1416943,
+ -0.07051762, 0.19488361, 0.02664691, -0.18104725, -0.09334311,
+ 0.15026465, -0.15493552, -0.057762887, -0.11604192, -0.262013,
+ -0.01391798, 0.012185008, 0.11156489, -0.07483202, 0.06693364,
+ -0.26151478, 0.046425626, 0.036540434, -0.16435726, 0.17338543,
+ -0.21401681, -0.11385144, -0.08283257, -0.069031075, 0.030635102,
+ 0.010969227, 0.11109743, 0.010919218, 0.027526086, 0.13519906,
+ 0.01891392, -0.046839405, -0.040167913, 0.017953383, -0.09700955,
+ 0.0061885654, -0.07000971, 0.026893595, -0.038844477, 0.14543656],
+
+ projection_bias: [],
+
+ activation_param: [4], # Tanh
+ cell_clip_param: [0.],
+ proj_clip_param: [0.],
+}
+
+# Batch0: 4 (input_sequence_size) * 5 (n_input)
+input0[input] = [0.596268, 0.998386, 0.568695, 0.864524, 0.571277]
+# Batch1: 4 (input_sequence_size) * 5 (n_input)
+input0[input].extend(
+ [0.642421, 0.524260, 0.134799, 0.003639, 0.162482]
+)
+input0[output_state_in] = [
+ -0.00396806, 0.029352, -0.00279226, 0.0159977,
+ -0.00835577, -0.0211779, 0.0283512, -0.0114597,
+ 0.00907307, -0.0244004, -0.0152191, -0.0259063,
+ 0.00914318, 0.00415119, 0.017147, 0.0134203,
+ -0.013869, 0.0287268, -0.00334694, 0.00733397,
+ -0.0287926, -0.0186926, 0.0193662, -0.0115437,
+ 0.00422612, -0.0345232, 0.00223253, -0.00957321,
+ 0.0210624, 0.013331, 0.0150954, 0.0216801,
+]
+input0[cell_state_in] = [
+ -0.0531632, -0.0118138, 0.0870833, 0.0347929,
+ -0.076144, -0.0659219, -0.0463811, 0.0141307,
+ -0.0127706, -0.03782, -0.00402401, -0.00571876,
+ -0.187957, -0.0247127, 0.0711425, 0.008244,
+ 0.0492649, 0.126972, 0.0933097, 0.29848,
+ -0.0966178, -0.114417, 0.0387229, 0.0453255,
+ -0.181286, -0.0651251, -0.0996879, -0.00276995,
+ 0.0617558, -0.0100728, 0.056304, -0.077416,
+ -0.162858, -0.0541251, 0.0571202, -0.0525331,
+ 0.0724297, 0.171029, 0.141738, 0.295483,
+]
+output0 = {
+ scratch_buffer: [ 0 for x in range(n_batch * n_cell * 4) ],
+ cell_state_out: [
+ -0.154022, -0.124934, 0.0478463, 0.0607819,
+ -0.218727, -0.111053, -0.103885, -0.00447221,
+ 0.0554757, -0.0207068, 0.0595767, -0.116297,
+ -0.249466, -0.0723206, 0.0794942, -0.0377107,
+ 0.124532, 0.249952, 0.188641, 0.411865,
+ -0.11012, -0.0694494, 0.103501, 0.0428427,
+ -0.167345, -0.106061, -0.0775679, 0.00936161,
+ 0.0105526, -0.0314523, 0.0243475, -0.132179,
+ -0.258763, -0.0307266, 0.107047, -0.0115197,
+ 0.0995485, 0.220027, 0.158355, 0.436369,
+ ],
+ output_state_out: [
+ -0.0166936, 0.0381209, 0.000889684, 0.0143363,
+ -0.0328911, -0.0234288, 0.0333051, -0.012229,
+ 0.0110322, -0.0457725, -0.000832209, -0.0202817,
+ 0.0327257, 0.0121309, 0.0155969, 0.0312091,
+ -0.0141913, 0.0322082, 0.00227024, 0.0260507,
+ -0.0188721, -0.0296489, 0.0399134, -0.0160509,
+ 0.011604, -0.0447318, -0.0150515, -0.0277406,
+ 0.0316596, 0.0118233, 0.0214762, 0.0293641
+ ],
+}
+
+# Batch0: 4 (input_sequence_size) * 16 (n_output)
+output0[output] = [
+ -0.0166936, 0.0381209, 0.000889694, 0.0143363,
+ -0.0328911, -0.0234288, 0.0333051, -0.012229, 0.0110322,
+ -0.0457725, -0.000832209, -0.0202817, 0.0327257, 0.0121308,
+ 0.0155969, 0.0312091]
+# Batch1: 4 (input_sequence_size) * 16 (n_output)
+output0[output].extend(
+ [-0.0141913, 0.0322082, 0.00227024, 0.0260507,
+ -0.0188721, -0.0296489, 0.0399134, -0.0160509, 0.0116039,
+ -0.0447318, -0.0150515, -0.0277406, 0.0316596, 0.0118233,
+ 0.0214762, 0.0293641]
+ )
+
+Example((input0, output0))
diff --git a/nn/runtime/test/specs/lstm3_state2.mod.py b/nn/runtime/test/specs/lstm3_state2.mod.py
new file mode 100644
index 000000000..da6004f7c
--- /dev/null
+++ b/nn/runtime/test/specs/lstm3_state2.mod.py
@@ -0,0 +1,687 @@
+#
+# Copyright (C) 2017 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+# LSTM Test, With Peephole, With Projection, No Clipping
+
+model = Model()
+
+n_batch = 2
+n_input = 5
+# n_cell and n_output have the same size when there is no projection.
+n_cell = 20
+n_output = 16
+
+input = Input("input", "TENSOR_FLOAT32", "{%d, %d}" % (n_batch, n_input))
+
+input_to_input_weights = Input("input_to_input_weights", "TENSOR_FLOAT32", "{%d, %d}" % (n_cell, n_input))
+input_to_forget_weights = Input("input_to_forget_weights", "TENSOR_FLOAT32", "{%d, %d}" % (n_cell, n_input))
+input_to_cell_weights = Input("input_to_cell_weights", "TENSOR_FLOAT32", "{%d, %d}" % (n_cell, n_input))
+input_to_output_weights = Input("input_to_output_weights", "TENSOR_FLOAT32", "{%d, %d}" % (n_cell, n_input))
+
+recurrent_to_input_weights = Input("recurrent_to_intput_weights", "TENSOR_FLOAT32", "{%d, %d}" % (n_cell, n_output))
+recurrent_to_forget_weights = Input("recurrent_to_forget_weights", "TENSOR_FLOAT32", "{%d, %d}" % (n_cell, n_output))
+recurrent_to_cell_weights = Input("recurrent_to_cell_weights", "TENSOR_FLOAT32", "{%d, %d}" % (n_cell, n_output))
+recurrent_to_output_weights = Input("recurrent_to_output_weights", "TENSOR_FLOAT32", "{%d, %d}" % (n_cell, n_output))
+
+cell_to_input_weights = Input("cell_to_input_weights", "TENSOR_FLOAT32", "{%d}" % (n_cell))
+cell_to_forget_weights = Input("cell_to_forget_weights", "TENSOR_FLOAT32", "{%d}" %(n_cell))
+cell_to_output_weights = Input("cell_to_output_weights", "TENSOR_FLOAT32", "{%d}" % (n_cell))
+
+input_gate_bias = Input("input_gate_bias", "TENSOR_FLOAT32", "{%d}"%(n_cell))
+forget_gate_bias = Input("forget_gate_bias", "TENSOR_FLOAT32", "{%d}"%(n_cell))
+cell_gate_bias = Input("cell_gate_bias", "TENSOR_FLOAT32", "{%d}"%(n_cell))
+output_gate_bias = Input("output_gate_bias", "TENSOR_FLOAT32", "{%d}"%(n_cell))
+
+projection_weights = Input("projection_weights", "TENSOR_FLOAT32", "{%d,%d}" % (n_output, n_cell))
+projection_bias = Input("projection_bias", "TENSOR_FLOAT32", "{0}")
+
+output_state_in = Input("output_state_in", "TENSOR_FLOAT32", "{%d, %d}" % (n_batch, n_output))
+cell_state_in = Input("cell_state_in", "TENSOR_FLOAT32", "{%d, %d}" % (n_batch, n_cell))
+
+activation_param = Input("activation_param", "TENSOR_INT32", "{1}");
+cell_clip_param = Input("cell_clip_param", "TENSOR_FLOAT32", "{1}")
+proj_clip_param = Input("proj_clip_param", "TENSOR_FLOAT32", "{1}")
+
+scratch_buffer = IgnoredOutput("scratch_buffer", "TENSOR_FLOAT32", "{%d, %d}" % (n_batch, (n_cell * 4)))
+output_state_out = Output("output_state_out", "TENSOR_FLOAT32", "{%d, %d}" % (n_batch, n_output))
+cell_state_out = Output("cell_state_out", "TENSOR_FLOAT32", "{%d, %d}" % (n_batch, n_cell))
+output = Output("output", "TENSOR_FLOAT32", "{%d, %d}" % (n_batch, n_output))
+
+# TODO: need support for more than one output
+model = model.Operation("LSTM",
+ input,
+
+ input_to_input_weights,
+ input_to_forget_weights,
+ input_to_cell_weights,
+ input_to_output_weights,
+
+ recurrent_to_input_weights,
+ recurrent_to_forget_weights,
+ recurrent_to_cell_weights,
+ recurrent_to_output_weights,
+
+ cell_to_input_weights,
+ cell_to_forget_weights,
+ cell_to_output_weights,
+
+ input_gate_bias,
+ forget_gate_bias,
+ cell_gate_bias,
+ output_gate_bias,
+
+ projection_weights,
+ projection_bias,
+
+ output_state_in,
+ cell_state_in,
+
+ activation_param,
+ cell_clip_param,
+ proj_clip_param
+).To([scratch_buffer, output_state_out, cell_state_out, output])
+
+input0 = {input_to_input_weights: [
+ 0.021393683, 0.06124551, 0.046905167, -0.014657677, -0.03149463,
+ 0.09171803, 0.14647801, 0.10797193, -0.0057968358, 0.0019193048,
+ -0.2726754, 0.10154029, -0.018539885, 0.080349885, -0.10262385,
+ -0.022599787, -0.09121155, -0.008675967, -0.045206103, -0.0821282,
+ -0.008045952, 0.015478081, 0.055217247, 0.038719587, 0.044153627,
+ -0.06453243, 0.05031825, -0.046935108, -0.008164439, 0.014574226,
+ -0.1671009, -0.15519552, -0.16819797, -0.13971269, -0.11953059,
+ 0.25005487, -0.22790983, 0.009855087, -0.028140958, -0.11200698,
+ 0.11295408, -0.0035217577, 0.054485075, 0.05184695, 0.064711206,
+ 0.10989193, 0.11674786, 0.03490607, 0.07727357, 0.11390585,
+ -0.1863375, -0.1034451, -0.13945189, -0.049401227, -0.18767063,
+ 0.042483903, 0.14233552, 0.13832581, 0.18350165, 0.14545603,
+ -0.028545704, 0.024939531, 0.050929718, 0.0076203286, -0.0029723682,
+ -0.042484224, -0.11827596, -0.09171104, -0.10808628, -0.16327988,
+ -0.2273378, -0.0993647, -0.017155107, 0.0023917493, 0.049272764,
+ 0.0038534778, 0.054764505, 0.089753784, 0.06947234, 0.08014476,
+ -0.04544234, -0.0497073, -0.07135631, -0.048929106, -0.004042012,
+ -0.009284026, 0.018042054, 0.0036860977, -0.07427302, -0.11434604,
+ -0.018995456, 0.031487543, 0.012834908, 0.019977754, 0.044256654,
+ -0.39292613, -0.18519334, -0.11651281, -0.06809892, 0.011373677],
+
+ input_to_forget_weights: [
+ -0.0018401089, -0.004852237, 0.03698424, 0.014181704, 0.028273236,
+ -0.016726194, -0.05249759, -0.10204261, 0.00861066, -0.040979505,
+ -0.009899187, 0.01923892, -0.028177269, -0.08535103, -0.14585495,
+ 0.10662567, -0.01909731, -0.017883534, -0.0047269356, -0.045103323,
+ 0.0030784295, 0.076784775, 0.07463696, 0.094531395, 0.0814421,
+ -0.12257899, -0.033945758, -0.031303465, 0.045630626, 0.06843887,
+ -0.13492945, -0.012480007, -0.0811829, -0.07224499, -0.09628791,
+ 0.045100946, 0.0012300825, 0.013964662, 0.099372394, 0.02543059,
+ 0.06958324, 0.034257296, 0.0482646, 0.06267997, 0.052625068,
+ 0.12784666, 0.07077897, 0.025725935, 0.04165009, 0.07241905,
+ 0.018668644, -0.037377294, -0.06277783, -0.08833636, -0.040120605,
+ -0.011405586, -0.007808335, -0.010301386, -0.005102167, 0.027717464,
+ 0.05483423, 0.11449111, 0.11289652, 0.10939839, 0.13396506,
+ -0.08402166, -0.01901462, -0.044678304, -0.07720565, 0.014350063,
+ -0.11757958, -0.0652038, -0.08185733, -0.076754324, -0.092614375,
+ 0.10405491, 0.052960336, 0.035755895, 0.035839386, -0.012540553,
+ 0.036881298, 0.02913376, 0.03420159, 0.05448447, -0.054523353,
+ 0.02582715, 0.02327355, -0.011857179, -0.0011980024, -0.034641717,
+ -0.026125094, -0.17582615, -0.15923657, -0.27486774, -0.0006143371,
+ 0.0001771948, -8.470171e-05, 0.02651807, 0.045790765, 0.06956496],
+
+ input_to_cell_weights: [
+ -0.04580283, -0.09549462, -0.032418985, -0.06454633,
+ -0.043528453, 0.043018587, -0.049152344, -0.12418144,
+ -0.078985475, -0.07596889, 0.019484362, -0.11434962,
+ -0.0074034138, -0.06314844, -0.092981495, 0.0062155537,
+ -0.025034338, -0.0028890965, 0.048929527, 0.06235075,
+ 0.10665918, -0.032036792, -0.08505916, -0.10843358,
+ -0.13002433, -0.036816437, -0.02130134, -0.016518239,
+ 0.0047691227, -0.0025825808, 0.066017866, 0.029991534,
+ -0.10652836, -0.1037554, -0.13056071, -0.03266643,
+ -0.033702414, -0.006473424, -0.04611692, 0.014419339,
+ -0.025174323, 0.0396852, 0.081777506, 0.06157468,
+ 0.10210095, -0.009658194, 0.046511717, 0.03603906,
+ 0.0069369148, 0.015960095, -0.06507666, 0.09551598,
+ 0.053568836, 0.06408714, 0.12835667, -0.008714329,
+ -0.20211966, -0.12093674, 0.029450472, 0.2849013,
+ -0.029227901, 0.1164364, -0.08560263, 0.09941786,
+ -0.036999565, -0.028842626, -0.0033637602, -0.017012902,
+ -0.09720865, -0.11193351, -0.029155117, -0.017936034,
+ -0.009768936, -0.04223324, -0.036159635, 0.06505112,
+ -0.021742892, -0.023377212, -0.07221364, -0.06430552,
+ 0.05453865, 0.091149814, 0.06387331, 0.007518393,
+ 0.055960953, 0.069779344, 0.046411168, 0.10509911,
+ 0.07463894, 0.0075130584, 0.012850982, 0.04555431,
+ 0.056955688, 0.06555285, 0.050801456, -0.009862683,
+ 0.00826772, -0.026555609, -0.0073611983, -0.0014897042],
+
+ input_to_output_weights: [
+ -0.0998932, -0.07201956, -0.052803773, -0.15629593, -0.15001918,
+ -0.07650751, 0.02359855, -0.075155355, -0.08037709, -0.15093534,
+ 0.029517552, -0.04751393, 0.010350531, -0.02664851, -0.016839722,
+ -0.023121163, 0.0077019283, 0.012851257, -0.05040649, -0.0129761,
+ -0.021737747, -0.038305793, -0.06870586, -0.01481247, -0.001285394,
+ 0.10124236, 0.083122835, 0.053313006, -0.062235646, -0.075637154,
+ -0.027833903, 0.029774971, 0.1130802, 0.09218906, 0.09506135,
+ -0.086665764, -0.037162706, -0.038880914, -0.035832845, -0.014481564,
+ -0.09825003, -0.12048569, -0.097665586, -0.05287633, -0.0964047,
+ -0.11366429, 0.035777505, 0.13568819, 0.052451383, 0.050649304,
+ 0.05798951, -0.021852335, -0.099848844, 0.014740475, -0.078897946,
+ 0.04974699, 0.014160473, 0.06973932, 0.04964942, 0.033364646,
+ 0.08190124, 0.025535367, 0.050893165, 0.048514254, 0.06945813,
+ -0.078907564, -0.06707616, -0.11844508, -0.09986688, -0.07509403,
+ 0.06263226, 0.14925587, 0.20188436, 0.12098451, 0.14639415,
+ 0.0015017595, -0.014267382, -0.03417257, 0.012711468, 0.0028300495,
+ -0.024758482, -0.05098548, -0.0821182, 0.014225672, 0.021544158,
+ 0.08949725, 0.07505268, -0.0020780868, 0.04908258, 0.06476295,
+ -0.022907063, 0.027562456, 0.040185735, 0.019567577, -0.015598739,
+ -0.049097303, -0.017121866, -0.083368234, -0.02332002, -0.0840956],
+
+ input_gate_bias: [
+ 0.02234832, 0.14757581, 0.18176508, 0.10380666, 0.053110216,
+ -0.06928846, -0.13942584, -0.11816189, 0.19483899, 0.03652339,
+ -0.10250295, 0.036714908, -0.18426876, 0.036065217, 0.21810818,
+ 0.02383196, -0.043370757, 0.08690144, -0.04444982, 0.00030581196],
+
+ forget_gate_bias: [
+ 0.035185695, -0.042891346, -0.03032477, 0.23027696,
+ 0.11098921, 0.15378423, 0.09263801, 0.09790885,
+ 0.09508917, 0.061199076, 0.07665568, -0.015443159,
+ -0.03499149, 0.046190713, 0.08895977, 0.10899629,
+ 0.40694186, 0.06030037, 0.012413437, -0.06108739],
+
+ cell_gate_bias: [
+ -0.024379363, 0.0055531194, 0.23377132, 0.033463873,
+ -0.1483596, -0.10639995, -0.091433935, 0.058573797,
+ -0.06809782, -0.07889636, -0.043246906, -0.09829136,
+ -0.4279842, 0.034901652, 0.18797937, 0.0075234566,
+ 0.016178843, 0.1749513, 0.13975595, 0.92058027],
+
+ output_gate_bias: [
+ 0.046159424, -0.0012809046, 0.03563469, 0.12648113, 0.027195795,
+ 0.35373217, -0.018957434, 0.008907322, -0.0762701, 0.12018895,
+ 0.04216877, 0.0022856654, 0.040952638, 0.3147856, 0.08225149,
+ -0.057416286, -0.14995944, -0.008040261, 0.13208859, 0.029760877],
+
+ recurrent_to_input_weights: [
+ -0.001374326, -0.078856036, 0.10672688, 0.029162422,
+ -0.11585556, 0.02557986, -0.13446963, -0.035785314,
+ -0.01244275, 0.025961924, -0.02337298, -0.044228926,
+ -0.055839065, -0.046598054, -0.010546039, -0.06900766,
+ 0.027239809, 0.022582639, -0.013296484, -0.05459212,
+ 0.08981, -0.045407712, 0.08682226, -0.06867011,
+ -0.14390695, -0.02916037, 0.000996957, 0.091420636,
+ 0.14283475, -0.07390571, -0.06402044, 0.062524505,
+ -0.093129106, 0.04860203, -0.08364217, -0.08119002,
+ 0.009352075, 0.22920375, 0.0016303885, 0.11583097,
+ -0.13732095, 0.012405723, -0.07551853, 0.06343048,
+ 0.12162708, -0.031923793, -0.014335606, 0.01790974,
+ -0.10650317, -0.0724401, 0.08554849, -0.05727212,
+ 0.06556731, -0.042729504, -0.043227166, 0.011683251,
+ -0.013082158, -0.029302018, -0.010899579, -0.062036745,
+ -0.022509435, -0.00964907, -0.01567329, 0.04260106,
+ -0.07787477, -0.11576462, 0.017356863, 0.048673786,
+ -0.017577527, -0.05527947, -0.082487635, -0.040137455,
+ -0.10820036, -0.04666372, 0.022746278, -0.07851417,
+ 0.01068115, 0.032956902, 0.022433773, 0.0026891115,
+ 0.08944216, -0.0685835, 0.010513544, 0.07228705,
+ 0.02032331, -0.059686817, -0.0005566496, -0.086984694,
+ 0.040414046, -0.1380399, 0.094208956, -0.05722982,
+ 0.012092817, -0.04989123, -0.086576, -0.003399834,
+ -0.04696032, -0.045747425, 0.10091314, 0.048676282,
+ -0.029037097, 0.031399418, -0.0040285117, 0.047237843,
+ 0.09504992, 0.041799378, -0.049185462, -0.031518843,
+ -0.10516937, 0.026374253, 0.10058866, -0.0033195973,
+ -0.041975245, 0.0073591834, 0.0033782164, -0.004325073,
+ -0.10167381, 0.042500053, -0.01447153, 0.06464186,
+ -0.017142897, 0.03312627, 0.009205989, 0.024138335,
+ -0.011337001, 0.035530265, -0.010912711, 0.0706555,
+ -0.005894094, 0.051841937, -0.1401738, -0.02351249,
+ 0.0365468, 0.07590991, 0.08838724, 0.021681072,
+ -0.10086113, 0.019608743, -0.06195883, 0.077335775,
+ 0.023646897, -0.095322326, 0.02233014, 0.09756986,
+ -0.048691444, -0.009579111, 0.07595467, 0.11480546,
+ -0.09801813, 0.019894179, 0.08502348, 0.004032281,
+ 0.037211012, 0.068537936, -0.048005626, -0.091520436,
+ -0.028379958, -0.01556313, 0.06554592, -0.045599163,
+ -0.01672207, -0.020169014, -0.011877351, -0.20212261,
+ 0.010889619, 0.0047078193, 0.038385306, 0.08540671,
+ -0.017140968, -0.0035865551, 0.016678626, 0.005633034,
+ 0.015963363, 0.00871737, 0.060130805, 0.028611384,
+ 0.10109069, -0.015060172, -0.07894427, 0.06401885,
+ 0.011584063, -0.024466386, 0.0047652307, -0.09041358,
+ 0.030737216, -0.0046374933, 0.14215417, -0.11823516,
+ 0.019899689, 0.006106124, -0.027092824, 0.0786356,
+ 0.05052217, -0.058925, -0.011402121, -0.024987547,
+ -0.0013661642, -0.06832946, -0.015667673, -0.1083353,
+ -0.00096863037, -0.06988685, -0.053350925, -0.027275559,
+ -0.033664223, -0.07978348, -0.025200296, -0.017207067,
+ -0.058403496, -0.055697463, 0.005798788, 0.12965427,
+ -0.062582195, 0.0013350133, -0.10482091, 0.0379771,
+ 0.072521195, -0.0029455067, -0.13797039, -0.03628521,
+ 0.013806405, -0.017858358, -0.01008298, -0.07700066,
+ -0.017081132, 0.019358726, 0.0027079724, 0.004635139,
+ 0.062634714, -0.02338735, -0.039547626, -0.02050681,
+ 0.03385117, -0.083611414, 0.002862572, -0.09421313,
+ 0.058618143, -0.08598433, 0.00972939, 0.023867095,
+ -0.053934585, -0.023203006, 0.07452513, -0.048767887,
+ -0.07314807, -0.056307215, -0.10433547, -0.06440842,
+ 0.04328182, 0.04389765, -0.020006588, -0.09076438,
+ -0.11652589, -0.021705797, 0.03345259, -0.010329105,
+ -0.025767034, 0.013057034, -0.07316461, -0.10145612,
+ 0.06358255, 0.18531723, 0.07759293, 0.12006465,
+ 0.1305557, 0.058638252, -0.03393652, 0.09622831,
+ -0.16253184, -2.4580743e-06, 0.079869635, -0.070196845,
+ -0.005644518, 0.06857898, -0.12598175, -0.035084512,
+ 0.03156317, -0.12794146, -0.031963028, 0.04692781,
+ 0.030070418, 0.0071660685, -0.095516115, -0.004643372,
+ 0.040170413, -0.062104587, -0.0037324072, 0.0554317,
+ 0.08184801, -0.019164372, 0.06791302, 0.034257166,
+ -0.10307039, 0.021943003, 0.046745934, 0.0790918,
+ -0.0265588, -0.007824208, 0.042546265, -0.00977924,
+ -0.0002440307, -0.017384544, -0.017990116, 0.12252321,
+ -0.014512694, -0.08251313, 0.08861942, 0.13589665,
+ 0.026351685, 0.012641483, 0.07466548, 0.044301085,
+ -0.045414884, -0.051112458, 0.03444247, -0.08502782,
+ -0.04106223, -0.028126027, 0.028473156, 0.10467447],
+
+ recurrent_to_forget_weights: [
+ -0.057784554, -0.026057621, -0.068447545, -0.022581743,
+ 0.14811787, 0.10826372, 0.09471067, 0.03987225,
+ -0.0039523416, 0.00030638507, 0.053185795, 0.10572994,
+ 0.08414449, -0.022036452, -0.00066928595, -0.09203576,
+ 0.032950465, -0.10985798, -0.023809856, 0.0021431844,
+ -0.02196096, -0.00326074, 0.00058621005, -0.074678116,
+ -0.06193199, 0.055729095, 0.03736828, 0.020123724,
+ 0.061878487, -0.04729229, 0.034919553, -0.07585433,
+ -0.04421272, -0.044019096, 0.085488975, 0.04058006,
+ -0.06890133, -0.030951202, -0.024628663, -0.07672815,
+ 0.034293607, 0.08556707, -0.05293577, -0.033561368,
+ -0.04899627, 0.0241671, 0.015736353, -0.095442444,
+ -0.029564252, 0.016493602, -0.035026584, 0.022337519,
+ -0.026871363, 0.004780428, 0.0077918363, -0.03601621,
+ 0.016435321, -0.03263031, -0.09543275, -0.047392778,
+ 0.013454138, 0.028934088, 0.01685226, -0.086110644,
+ -0.046250615, -0.01847454, 0.047608484, 0.07339695,
+ 0.034546845, -0.04881143, 0.009128804, -0.08802852,
+ 0.03761666, 0.008096139, -0.014454086, 0.014361001,
+ -0.023502491, -0.0011840804, -0.07607001, 0.001856849,
+ -0.06509276, -0.006021153, -0.08570962, -0.1451793,
+ 0.060212336, 0.055259194, 0.06974018, 0.049454916,
+ -0.027794661, -0.08077226, -0.016179763, 0.1169753,
+ 0.17213494, -0.0056326236, -0.053934924, -0.0124349,
+ -0.11520337, 0.05409887, 0.088759385, 0.0019655675,
+ 0.0042065294, 0.03881498, 0.019844765, 0.041858196,
+ -0.05695512, 0.047233116, 0.038937137, -0.06542224,
+ 0.014429736, -0.09719407, 0.13908425, -0.05379757,
+ 0.012321099, 0.082840554, -0.029899208, 0.044217527,
+ 0.059855383, 0.07711018, -0.045319796, 0.0948846,
+ -0.011724666, -0.0033288454, -0.033542685, -0.04764985,
+ -0.13873616, 0.040668588, 0.034832682, -0.015319203,
+ -0.018715994, 0.046002675, 0.0599172, -0.043107376,
+ 0.0294216, -0.002314414, -0.022424703, 0.0030315618,
+ 0.0014641669, 0.0029166266, -0.11878115, 0.013738511,
+ 0.12375372, -0.0006038222, 0.029104086, 0.087442465,
+ 0.052958444, 0.07558703, 0.04817258, 0.044462286,
+ -0.015213451, -0.08783778, -0.0561384, -0.003008196,
+ 0.047060397, -0.002058388, 0.03429439, -0.018839769,
+ 0.024734668, 0.024614193, -0.042046934, 0.09597743,
+ -0.0043254104, 0.04320769, 0.0064070094, -0.0019131786,
+ -0.02558259, -0.022822596, -0.023273505, -0.02464396,
+ -0.10991725, -0.006240552, 0.0074488563, 0.024044557,
+ 0.04383914, -0.046476185, 0.028658995, 0.060410924,
+ 0.050786525, 0.009452605, -0.0073054377, -0.024810238,
+ 0.0052906186, 0.0066939713, -0.0020913032, 0.014515517,
+ 0.015898481, 0.021362653, -0.030262267, 0.016587038,
+ -0.011442813, 0.041154444, -0.007631438, -0.03423484,
+ -0.010977775, 0.036152758, 0.0066366293, 0.11915515,
+ 0.02318443, -0.041350313, 0.021485701, -0.10906167,
+ -0.028218046, -0.00954771, 0.020531068, -0.11995105,
+ -0.03672871, 0.024019798, 0.014255957, -0.05221243,
+ -0.00661567, -0.04630967, 0.033188973, 0.10107534,
+ -0.014027541, 0.030796422, -0.10270911, -0.035999842,
+ 0.15443139, 0.07684145, 0.036571592, -0.035900835,
+ -0.0034699554, 0.06209149, 0.015920248, -0.031122351,
+ -0.03858649, 0.01849943, 0.13872518, 0.01503974,
+ 0.069941424, -0.06948533, -0.0088794185, 0.061282158,
+ -0.047401894, 0.03100163, -0.041533746, -0.10430945,
+ 0.044574402, -0.01425562, -0.024290353, 0.034563623,
+ 0.05866852, 0.023947537, -0.09445152, 0.035450947,
+ 0.02247216, -0.0042998926, 0.061146557, -0.10250651,
+ 0.020881841, -0.06747029, 0.10062043, -0.0023941975,
+ 0.03532124, -0.016341697, 0.09685456, -0.016764693,
+ 0.051808182, 0.05875331, -0.04536488, 0.001626336,
+ -0.028892258, -0.01048663, -0.009793449, -0.017093895,
+ 0.010987891, 0.02357273, -0.00010856845, 0.0099760275,
+ -0.001845119, -0.03551521, 0.0018358806, 0.05763657,
+ -0.01769146, 0.040995963, 0.02235177, -0.060430344,
+ 0.11475477, -0.023854522, 0.10071741, 0.0686208,
+ -0.014250481, 0.034261297, 0.047418304, 0.08562733,
+ -0.030519066, 0.0060542435, 0.014653856, -0.038836084,
+ 0.04096551, 0.032249358, -0.08355519, -0.026823482,
+ 0.056386515, -0.010401743, -0.028396193, 0.08507674,
+ 0.014410365, 0.020995233, 0.17040324, 0.11511526,
+ 0.02459721, 0.0066619175, 0.025853224, -0.023133837,
+ -0.081302024, 0.017264642, -0.009585969, 0.09491168,
+ -0.051313367, 0.054532815, -0.014298593, 0.10657464,
+ 0.007076659, 0.10964551, 0.0409152, 0.008275321,
+ -0.07283536, 0.07937492, 0.04192024, -0.1075027],
+
+ recurrent_to_cell_weights: [
+ -0.037322544, 0.018592842, 0.0056175636, -0.06253426,
+ 0.055647098, -0.05713207, -0.05626563, 0.005559383,
+ 0.03375411, -0.025757805, -0.088049285, 0.06017052,
+ -0.06570978, 0.007384076, 0.035123326, -0.07920549,
+ 0.053676967, 0.044480428, -0.07663568, 0.0071805613,
+ 0.08089997, 0.05143358, 0.038261272, 0.03339287,
+ -0.027673481, 0.044746667, 0.028349208, 0.020090483,
+ -0.019443132, -0.030755889, -0.0040000007, 0.04465846,
+ -0.021585021, 0.0031670958, 0.0053199246, -0.056117613,
+ -0.10893326, 0.076739706, -0.08509834, -0.027997585,
+ 0.037871376, 0.01449768, -0.09002357, -0.06111149,
+ -0.046195522, 0.0422062, -0.005683705, -0.1253618,
+ -0.012925729, -0.04890792, 0.06985068, 0.037654128,
+ 0.03398274, -0.004781977, 0.007032333, -0.031787455,
+ 0.010868644, -0.031489216, 0.09525667, 0.013939797,
+ 0.0058680447, 0.0167067, 0.02668468, -0.04797466,
+ -0.048885044, -0.12722108, 0.035304096, 0.06554885,
+ 0.00972396, -0.039238118, -0.05159735, -0.11329045,
+ 0.1613692, -0.03750952, 0.06529313, -0.071974665,
+ -0.11769596, 0.015524369, -0.0013754242, -0.12446318,
+ 0.02786344, -0.014179351, 0.005264273, 0.14376344,
+ 0.015983658, 0.03406988, -0.06939408, 0.040699873,
+ 0.02111075, 0.09669095, 0.041345075, -0.08316494,
+ -0.07684199, -0.045768797, 0.032298047, -0.041805092,
+ 0.0119405, 0.0061010392, 0.12652606, 0.0064572375,
+ -0.024950314, 0.11574242, 0.04508852, -0.04335324,
+ 0.06760663, -0.027437469, 0.07216407, 0.06977076,
+ -0.05438599, 0.034033038, -0.028602652, 0.05346137,
+ 0.043184172, -0.037189785, 0.10420091, 0.00882477,
+ -0.054019816, -0.074273005, -0.030617684, -0.0028467078,
+ 0.024302477, -0.0038869337, 0.005332455, 0.0013399826,
+ 0.04361412, -0.007001822, 0.09631092, -0.06702025,
+ -0.042049985, -0.035070654, -0.04103342, -0.10273396,
+ 0.0544271, 0.037184782, -0.13150354, -0.0058036847,
+ -0.008264958, 0.042035464, 0.05891794, 0.029673764,
+ 0.0063542654, 0.044788733, 0.054816857, 0.062257513,
+ -0.00093483756, 0.048938446, -0.004952862, -0.007730018,
+ -0.04043371, -0.017094059, 0.07229206, -0.023670016,
+ -0.052195564, -0.025616996, -0.01520939, 0.045104615,
+ -0.007376126, 0.003533447, 0.006570588, 0.056037236,
+ 0.12436656, 0.051817212, 0.028532185, -0.08686856,
+ 0.11868599, 0.07663395, -0.07323171, 0.03463402,
+ -0.050708205, -0.04458982, -0.11590894, 0.021273347,
+ 0.1251325, -0.15313013, -0.12224372, 0.17228661,
+ 0.023029093, 0.086124025, 0.006445803, -0.03496501,
+ 0.028332196, 0.04449512, -0.042436164, -0.026587414,
+ -0.006041347, -0.09292539, -0.05678812, 0.03897832,
+ 0.09465633, 0.008115513, -0.02171956, 0.08304309,
+ 0.071401566, 0.019622514, 0.032163795, -0.004167056,
+ 0.02295182, 0.030739572, 0.056506045, 0.004612461,
+ 0.06524936, 0.059999723, 0.046395954, -0.0045512207,
+ -0.1335546, -0.030136576, 0.11584653, -0.014678886,
+ 0.0020118146, -0.09688814, -0.0790206, 0.039770417,
+ -0.0329582, 0.07922767, 0.029322514, 0.026405897,
+ 0.04207835, -0.07073373, 0.063781224, 0.0859677,
+ -0.10925287, -0.07011058, 0.048005477, 0.03438226,
+ -0.09606514, -0.006669445, -0.043381985, 0.04240257,
+ -0.06955775, -0.06769346, 0.043903265, -0.026784198,
+ -0.017840602, 0.024307009, -0.040079936, -0.019946516,
+ 0.045318738, -0.12233574, 0.026170589, 0.0074471775,
+ 0.15978073, 0.10185836, 0.10298046, -0.015476589,
+ -0.039390966, -0.072174534, 0.0739445, -0.1211869,
+ -0.0347889, -0.07943156, 0.014809798, -0.12412325,
+ -0.0030663363, 0.039695457, 0.0647603, -0.08291318,
+ -0.018529687, -0.004423833, 0.0037507233, 0.084633216,
+ -0.01514876, -0.056505352, -0.012800942, -0.06994386,
+ 0.012962922, -0.031234352, 0.07029052, 0.016418684,
+ 0.03618972, 0.055686004, -0.08663945, -0.017404709,
+ -0.054761406, 0.029065743, 0.052404847, 0.020238016,
+ 0.0048197987, -0.0214882, 0.07078733, 0.013016777,
+ 0.06262858, 0.009184685, 0.020785125, -0.043904778,
+ -0.0270329, -0.03299152, -0.060088247, -0.015162964,
+ -0.001828936, 0.12642565, -0.056757294, 0.013586685,
+ 0.09232601, -0.035886683, 0.06000002, 0.05229691,
+ -0.052580316, -0.082029596, -0.010794592, 0.012947712,
+ -0.036429964, -0.085508935, -0.13127148, -0.017744139,
+ 0.031502828, 0.036232427, -0.031581745, 0.023051167,
+ -0.05325106, -0.03421577, 0.028793324, -0.034633752,
+ -0.009881397, -0.043551125, -0.018609839, 0.0019097115,
+ -0.008799762, 0.056595087, 0.0022273948, 0.055752404],
+
+ recurrent_to_output_weights: [
+ 0.025825322, -0.05813119, 0.09495884, -0.045984812, -0.01255415,
+ -0.0026479573, -0.08196161, -0.054914974, -0.0046604523, -0.029587349,
+ -0.044576716, -0.07480124, -0.082868785, 0.023254942, 0.027502948,
+ -0.0039728214, -0.08683098, -0.08116779, -0.014675607, -0.037924774,
+ -0.023314456, -0.007401714, -0.09255757, 0.029460307, -0.08829125,
+ -0.005139627, -0.08989442, -0.0555066, 0.13596267, -0.025062224,
+ -0.048351806, -0.03850004, 0.07266485, -0.022414139, 0.05940088,
+ 0.075114764, 0.09597592, -0.010211725, -0.0049794707, -0.011523867,
+ -0.025980417, 0.072999895, 0.11091378, -0.081685916, 0.014416728,
+ 0.043229222, 0.034178585, -0.07530371, 0.035837382, -0.085607,
+ -0.007721233, -0.03287832, -0.043848954, -0.06404588, -0.06632928,
+ -0.073643476, 0.008214239, -0.045984086, 0.039764922, 0.03474462,
+ 0.060612556, -0.080590084, 0.049127717, 0.04151091, -0.030063879,
+ 0.008801774, -0.023021035, -0.019558564, 0.05158114, -0.010947698,
+ -0.011825728, 0.0075720972, 0.0699727, -0.0039981045, 0.069350146,
+ 0.08799282, 0.016156472, 0.035502106, 0.11695009, 0.006217345,
+ 0.13392477, -0.037875112, 0.025745004, 0.08940699, -0.00924166,
+ 0.0046702605, -0.036598757, -0.08811812, 0.10522024, -0.032441203,
+ 0.008176899, -0.04454919, 0.07058152, 0.0067963637, 0.039206743,
+ 0.03259838, 0.03725492, -0.09515802, 0.013326398, -0.052055415,
+ -0.025676316, 0.03198509, -0.015951829, -0.058556724, 0.036879618,
+ 0.043357447, 0.028362012, -0.05908629, 0.0059240665, -0.04995891,
+ -0.019187413, 0.0276265, -0.01628143, 0.0025863599, 0.08800015,
+ 0.035250366, -0.022165963, -0.07328642, -0.009415526, -0.07455109,
+ 0.11690406, 0.0363299, 0.07411125, 0.042103454, -0.009660886,
+ 0.019076364, 0.018299393, -0.046004917, 0.08891175, 0.0431396,
+ -0.026327137, -0.051502608, 0.08979574, -0.051670972, 0.04940282,
+ -0.07491107, -0.021240504, 0.022596184, -0.034280192, 0.060163025,
+ -0.058211457, -0.051837247, -0.01349775, -0.04639988, -0.035936575,
+ -0.011681591, 0.064818054, 0.0073146066, -0.021745546, -0.043124277,
+ -0.06471268, -0.07053354, -0.029321948, -0.05330136, 0.016933719,
+ -0.053782392, 0.13747959, -0.1361751, -0.11569455, 0.0033329215,
+ 0.05693899, -0.053219706, 0.063698, 0.07977434, -0.07924483,
+ 0.06936997, 0.0034815092, -0.007305279, -0.037325785, -0.07251102,
+ -0.033633437, -0.08677009, 0.091591336, -0.14165086, 0.021752775,
+ 0.019683983, 0.0011612234, -0.058154266, 0.049996935, 0.0288841,
+ -0.0024567875, -0.14345716, 0.010955264, -0.10234828, 0.1183656,
+ -0.0010731248, -0.023590032, -0.072285876, -0.0724771, -0.026382286,
+ -0.0014920527, 0.042667855, 0.0018776858, 0.02986552, 0.009814309,
+ 0.0733756, 0.12289186, 0.018043943, -0.0458958, 0.049412545,
+ 0.033632483, 0.05495232, 0.036686596, -0.013781798, -0.010036754,
+ 0.02576849, -0.08307328, 0.010112348, 0.042521734, -0.05869831,
+ -0.071689695, 0.03876447, -0.13275425, -0.0352966, -0.023077697,
+ 0.10285965, 0.084736146, 0.15568255, -0.00040734606, 0.027835453,
+ -0.10292561, -0.032401145, 0.10053256, -0.026142767, -0.08271222,
+ -0.0030240538, -0.016368777, 0.1070414, 0.042672627, 0.013456989,
+ -0.0437609, -0.022309763, 0.11576483, 0.04108048, 0.061026827,
+ -0.0190714, -0.0869359, 0.037901703, 0.0610107, 0.07202949,
+ 0.01675338, 0.086139716, -0.08795751, -0.014898893, -0.023771819,
+ -0.01965048, 0.007955471, -0.043740474, 0.03346837, -0.10549954,
+ 0.090567775, 0.042013682, -0.03176985, 0.12569028, -0.02421228,
+ -0.029526481, 0.023851605, 0.031539805, 0.05292009, -0.02344001,
+ -0.07811758, -0.08834428, 0.10094801, 0.16594367, -0.06861939,
+ -0.021256343, -0.041093912, -0.06669611, 0.035498552, 0.021757556,
+ -0.09302526, -0.015403468, -0.06614931, -0.051798206, -0.013874718,
+ 0.03630673, 0.010412845, -0.08077351, 0.046185967, 0.0035662893,
+ 0.03541868, -0.094149634, -0.034814864, 0.003128424, -0.020674974,
+ -0.03944324, -0.008110165, -0.11113267, 0.08484226, 0.043586485,
+ 0.040582247, 0.0968012, -0.065249965, -0.028036479, 0.0050708856,
+ 0.0017462453, 0.0326779, 0.041296225, 0.09164146, -0.047743853,
+ -0.015952192, -0.034451712, 0.084197424, -0.05347844, -0.11768019,
+ 0.085926116, -0.08251791, -0.045081906, 0.0948852, 0.068401024,
+ 0.024856757, 0.06978981, -0.057309967, -0.012775832, -0.0032452994,
+ 0.01977615, -0.041040014, -0.024264973, 0.063464895, 0.05431621],
+
+ cell_to_input_weights: [
+ 0.040369894, 0.030746894, 0.24704495, 0.018586371, -0.037586458,
+ -0.15312155, -0.11812848, -0.11465643, 0.20259799, 0.11418174,
+ -0.10116027, -0.011334949, 0.12411352, -0.076769054, -0.052169047,
+ 0.21198851, -0.38871562, -0.09061183, -0.09683246, -0.21929175],
+
+ cell_to_forget_weights: [
+ -0.01998659, -0.15568835, -0.24248174, -0.012770197, 0.041331276,
+ -0.072311886, -0.052123554, -0.0066330447, -0.043891653, 0.036225766,
+ -0.047248036, 0.021479502, 0.033189066, 0.11952997, -0.020432774,
+ 0.64658105, -0.06650122, -0.03467612, 0.095340036, 0.23647355],
+
+ cell_to_output_weights: [
+ 0.08286371, -0.08261836, -0.51210177, 0.002913762, 0.17764764,
+ -0.5495371, -0.08460716, -0.24552552, 0.030037103, 0.04123544,
+ -0.11940523, 0.007358328, 0.1890978, 0.4833202, -0.34441817,
+ 0.36312827, -0.26375428, 0.1457655, -0.19724406, 0.15548733],
+
+ projection_weights: [
+ -0.009802181, 0.09401916, 0.0717386, -0.13895074, 0.09641832,
+ 0.060420845, 0.08539281, 0.054285463, 0.061395317, 0.034448683,
+ -0.042991187, 0.019801661, -0.16840284, -0.015726732, -0.23041931,
+ -0.024478018, -0.10959692, -0.013875541, 0.18600968, -0.061274476,
+ 0.0138165, -0.08160894, -0.07661644, 0.032372914, 0.16169067,
+ 0.22465782, -0.03993472, -0.004017731, 0.08633481, -0.28869787,
+ 0.08682067, 0.17240396, 0.014975425, 0.056431185, 0.031037588,
+ 0.16702051, 0.0077946745, 0.15140012, 0.29405436, 0.120285,
+ -0.188994, -0.027265169, 0.043389652, -0.022061434, 0.014777949,
+ -0.20203483, 0.094781205, 0.19100232, 0.13987629, -0.036132768,
+ -0.06426278, -0.05108664, 0.13221376, 0.009441198, -0.16715929,
+ 0.15859416, -0.040437475, 0.050779544, -0.022187516, 0.012166504,
+ 0.027685808, -0.07675938, -0.0055694645, -0.09444123, 0.0046453946,
+ 0.050794356, 0.10770313, -0.20790008, -0.07149004, -0.11425117,
+ 0.008225835, -0.035802525, 0.14374903, 0.15262283, 0.048710253,
+ 0.1847461, -0.007487823, 0.11000021, -0.09542012, 0.22619456,
+ -0.029149994, 0.08527916, 0.009043713, 0.0042746216, 0.016261552,
+ 0.022461696, 0.12689082, -0.043589946, -0.12035478, -0.08361797,
+ -0.050666027, -0.1248618, -0.1275799, -0.071875185, 0.07377272,
+ 0.09944291, -0.18897448, -0.1593054, -0.06526116, -0.040107165,
+ -0.004618631, -0.067624845, -0.007576253, 0.10727444, 0.041546922,
+ -0.20424393, 0.06907816, 0.050412357, 0.00724631, 0.039827548,
+ 0.12449835, 0.10747581, 0.13708383, 0.09134148, -0.12617786,
+ -0.06428341, 0.09956831, 0.1208086, -0.14676677, -0.0727722,
+ 0.1126304, 0.010139365, 0.015571211, -0.038128063, 0.022913318,
+ -0.042050496, 0.16842307, -0.060597885, 0.10531834, -0.06411776,
+ -0.07451711, -0.03410368, -0.13393489, 0.06534304, 0.003620307,
+ 0.04490757, 0.05970546, 0.05197996, 0.02839995, 0.10434969,
+ -0.013699693, -0.028353551, -0.07260381, 0.047201227, -0.024575593,
+ -0.036445823, 0.07155557, 0.009672501, -0.02328883, 0.009533515,
+ -0.03606021, -0.07421458, -0.028082801, -0.2678904, -0.13221288,
+ 0.18419984, -0.13012612, -0.014588381, -0.035059117, -0.04824723,
+ 0.07830115, -0.056184657, 0.03277091, 0.025466874, 0.14494097,
+ -0.12522776, -0.098633975, -0.10766018, -0.08317623, 0.08594209,
+ 0.07749552, 0.039474737, 0.1776665, -0.07409566, -0.0477268,
+ 0.29323658, 0.10801441, 0.1154011, 0.013952499, 0.10739139,
+ 0.10708251, -0.051456142, 0.0074137426, -0.10430189, 0.10034707,
+ 0.045594677, 0.0635285, -0.0715442, -0.089667566, -0.10811871,
+ 0.00026344223, 0.08298446, -0.009525053, 0.006585689, -0.24567553,
+ -0.09450807, 0.09648481, 0.026996298, -0.06419476, -0.04752702,
+ -0.11063944, -0.23441927, -0.17608605, -0.052156363, 0.067035615,
+ 0.19271925, -0.0032889997, -0.043264326, 0.09663576, -0.057112187,
+ -0.10100678, 0.0628376, 0.04447668, 0.017961001, -0.10094388,
+ -0.10190601, 0.18335468, 0.10494553, -0.052095775, -0.0026118709,
+ 0.10539724, -0.04383912, -0.042349473, 0.08438151, -0.1947263,
+ 0.02251204, 0.11216432, -0.10307853, 0.17351969, -0.039091777,
+ 0.08066188, -0.00561982, 0.12633002, 0.11335965, -0.0088127935,
+ -0.019777594, 0.06864014, -0.059751723, 0.016233567, -0.06894641,
+ -0.28651384, -0.004228674, 0.019708522, -0.16305895, -0.07468996,
+ -0.0855457, 0.099339016, -0.07580735, -0.13775392, 0.08434318,
+ 0.08330512, -0.12131499, 0.031935584, 0.09180414, -0.08876437,
+ -0.08049874, 0.008753825, 0.03498998, 0.030215185, 0.03907079,
+ 0.089751154, 0.029194152, -0.03337423, -0.019092513, 0.04331237,
+ 0.04299654, -0.036394123, -0.12915532, 0.09793732, 0.07512415,
+ -0.11319543, -0.032502122, 0.15661901, 0.07671967, -0.005491124,
+ -0.19379048, -0.218606, 0.21448623, 0.017840758, 0.1416943,
+ -0.07051762, 0.19488361, 0.02664691, -0.18104725, -0.09334311,
+ 0.15026465, -0.15493552, -0.057762887, -0.11604192, -0.262013,
+ -0.01391798, 0.012185008, 0.11156489, -0.07483202, 0.06693364,
+ -0.26151478, 0.046425626, 0.036540434, -0.16435726, 0.17338543,
+ -0.21401681, -0.11385144, -0.08283257, -0.069031075, 0.030635102,
+ 0.010969227, 0.11109743, 0.010919218, 0.027526086, 0.13519906,
+ 0.01891392, -0.046839405, -0.040167913, 0.017953383, -0.09700955,
+ 0.0061885654, -0.07000971, 0.026893595, -0.038844477, 0.14543656],
+
+ projection_bias: [],
+
+ activation_param: [4], # Tanh
+ cell_clip_param: [0.],
+ proj_clip_param: [0.],
+}
+
+# Batch0: 4 (input_sequence_size) * 5 (n_input)
+input0[input] = [0.073204, 0.296072, 0.743333, 0.069199, 0.045348]
+# Batch1: 4 (input_sequence_size) * 5 (n_input)
+input0[input].extend(
+ [0.640394, 0.930399, 0.050782, 0.432485, 0.988078]
+)
+input0[output_state_in] = [
+ -0.0166936, 0.0381209, 0.000889684, 0.0143363,
+ -0.0328911, -0.0234288, 0.0333051, -0.012229,
+ 0.0110322, -0.0457725, -0.000832209, -0.0202817,
+ 0.0327257, 0.0121309, 0.0155969, 0.0312091,
+ -0.0141913, 0.0322082, 0.00227024, 0.0260507,
+ -0.0188721, -0.0296489, 0.0399134, -0.0160509,
+ 0.011604, -0.0447318, -0.0150515, -0.0277406,
+ 0.0316596, 0.0118233, 0.0214762, 0.0293641,
+]
+input0[cell_state_in] = [
+ -0.154022, -0.124934, 0.0478463, 0.0607819,
+ -0.218727, -0.111053, -0.103885, -0.00447221,
+ 0.0554757, -0.0207068, 0.0595767, -0.116297,
+ -0.249466, -0.0723206, 0.0794942, -0.0377107,
+ 0.124532, 0.249952, 0.188641, 0.411865,
+ -0.11012, -0.0694494, 0.103501, 0.0428427,
+ -0.167345, -0.106061, -0.0775679, 0.00936161,
+ 0.0105526, -0.0314523, 0.0243475, -0.132179,
+ -0.258763, -0.0307266, 0.107047, -0.0115197,
+ 0.0995485, 0.220027, 0.158355, 0.436369,
+]
+output0 = {
+ scratch_buffer: [ 0 for x in range(n_batch * n_cell * 4) ],
+ cell_state_out: [
+ -0.126572, -0.121882, 0.121569, 0.0489971,
+ -0.240177, -0.124685, -0.122565, 0.0162748,
+ 0.0317536, -0.0270355, 0.0418199, -0.179755,
+ -0.327279, -0.0342741, 0.133831, -0.0238279,
+ 0.122148, 0.269115, 0.185989, 0.525976,
+ -0.167208, -0.109612, 0.0531226, 0.0695387,
+ -0.248335, -0.134123, -0.108246, 0.00628498,
+ 0.0492984, -0.0264919, 0.0698144, -0.0635602,
+ -0.295363, -0.0760078, 0.102725, -0.0351708,
+ 0.149804, 0.259131, 0.202573, 0.500664,
+ ],
+ output_state_out: [
+ -0.0213783, 0.0350169, 0.000324787, 0.0276012,
+ -0.0263374, -0.0371449, 0.0446149, -0.0205474,
+ 0.0103729, -0.0576349, -0.0150052, -0.0292043,
+ 0.0376827, 0.0136115, 0.0243435, 0.0354492,
+ -0.0204549, 0.0450315, -0.00117379, 0.0167673,
+ -0.0375007, -0.0238314, 0.038784, -0.0174034,
+ 0.0131743, -0.0506589, -0.00484469, -0.0240239,
+ 0.0325789, 0.00790064, 0.0220157, 0.0333314,
+ ],
+}
+
+# Batch0: 4 (input_sequence_size) * 16 (n_output)
+output0[output] = [
+ -0.0213783, 0.0350169, 0.000324794,
+ 0.0276012, -0.0263374, -0.0371449, 0.0446149, -0.0205474,
+ 0.0103729, -0.0576349, -0.0150052, -0.0292043, 0.0376827,
+ 0.0136115, 0.0243435, 0.0354492]
+# Batch1: 4 (input_sequence_size) * 16 (n_output)
+output0[output].extend(
+ [-0.0204549, 0.0450315, -0.00117378,
+ 0.0167673, -0.0375007, -0.0238314, 0.038784, -0.0174034,
+ 0.0131743, -0.0506589, -0.0048447, -0.0240239, 0.0325789,
+ 0.00790065, 0.0220157, 0.0333314],
+ )
+
+Example((input0, output0))
diff --git a/nn/runtime/test/specs/lstm3_state3.mod.py b/nn/runtime/test/specs/lstm3_state3.mod.py
new file mode 100644
index 000000000..b55511471
--- /dev/null
+++ b/nn/runtime/test/specs/lstm3_state3.mod.py
@@ -0,0 +1,667 @@
+#
+# Copyright (C) 2017 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+# LSTM Test, With Peephole, With Projection, No Clipping
+
+model = Model()
+
+n_batch = 2
+n_input = 5
+# n_cell and n_output have the same size when there is no projection.
+n_cell = 20
+n_output = 16
+
+input = Input("input", "TENSOR_FLOAT32", "{%d, %d}" % (n_batch, n_input))
+
+input_to_input_weights = Input("input_to_input_weights", "TENSOR_FLOAT32", "{%d, %d}" % (n_cell, n_input))
+input_to_forget_weights = Input("input_to_forget_weights", "TENSOR_FLOAT32", "{%d, %d}" % (n_cell, n_input))
+input_to_cell_weights = Input("input_to_cell_weights", "TENSOR_FLOAT32", "{%d, %d}" % (n_cell, n_input))
+input_to_output_weights = Input("input_to_output_weights", "TENSOR_FLOAT32", "{%d, %d}" % (n_cell, n_input))
+
+recurrent_to_input_weights = Input("recurrent_to_intput_weights", "TENSOR_FLOAT32", "{%d, %d}" % (n_cell, n_output))
+recurrent_to_forget_weights = Input("recurrent_to_forget_weights", "TENSOR_FLOAT32", "{%d, %d}" % (n_cell, n_output))
+recurrent_to_cell_weights = Input("recurrent_to_cell_weights", "TENSOR_FLOAT32", "{%d, %d}" % (n_cell, n_output))
+recurrent_to_output_weights = Input("recurrent_to_output_weights", "TENSOR_FLOAT32", "{%d, %d}" % (n_cell, n_output))
+
+cell_to_input_weights = Input("cell_to_input_weights", "TENSOR_FLOAT32", "{%d}" % (n_cell))
+cell_to_forget_weights = Input("cell_to_forget_weights", "TENSOR_FLOAT32", "{%d}" %(n_cell))
+cell_to_output_weights = Input("cell_to_output_weights", "TENSOR_FLOAT32", "{%d}" % (n_cell))
+
+input_gate_bias = Input("input_gate_bias", "TENSOR_FLOAT32", "{%d}"%(n_cell))
+forget_gate_bias = Input("forget_gate_bias", "TENSOR_FLOAT32", "{%d}"%(n_cell))
+cell_gate_bias = Input("cell_gate_bias", "TENSOR_FLOAT32", "{%d}"%(n_cell))
+output_gate_bias = Input("output_gate_bias", "TENSOR_FLOAT32", "{%d}"%(n_cell))
+
+projection_weights = Input("projection_weights", "TENSOR_FLOAT32", "{%d,%d}" % (n_output, n_cell))
+projection_bias = Input("projection_bias", "TENSOR_FLOAT32", "{0}")
+
+output_state_in = Input("output_state_in", "TENSOR_FLOAT32", "{%d, %d}" % (n_batch, n_output))
+cell_state_in = Input("cell_state_in", "TENSOR_FLOAT32", "{%d, %d}" % (n_batch, n_cell))
+
+activation_param = Input("activation_param", "TENSOR_INT32", "{1}");
+cell_clip_param = Input("cell_clip_param", "TENSOR_FLOAT32", "{1}")
+proj_clip_param = Input("proj_clip_param", "TENSOR_FLOAT32", "{1}")
+
+scratch_buffer = IgnoredOutput("scratch_buffer", "TENSOR_FLOAT32", "{%d, %d}" % (n_batch, (n_cell * 4)))
+output_state_out = IgnoredOutput("output_state_out", "TENSOR_FLOAT32", "{%d, %d}" % (n_batch, n_output))
+cell_state_out = IgnoredOutput("cell_state_out", "TENSOR_FLOAT32", "{%d, %d}" % (n_batch, n_cell))
+output = Output("output", "TENSOR_FLOAT32", "{%d, %d}" % (n_batch, n_output))
+
+# TODO: need support for more than one output
+model = model.Operation("LSTM",
+ input,
+
+ input_to_input_weights,
+ input_to_forget_weights,
+ input_to_cell_weights,
+ input_to_output_weights,
+
+ recurrent_to_input_weights,
+ recurrent_to_forget_weights,
+ recurrent_to_cell_weights,
+ recurrent_to_output_weights,
+
+ cell_to_input_weights,
+ cell_to_forget_weights,
+ cell_to_output_weights,
+
+ input_gate_bias,
+ forget_gate_bias,
+ cell_gate_bias,
+ output_gate_bias,
+
+ projection_weights,
+ projection_bias,
+
+ output_state_in,
+ cell_state_in,
+
+ activation_param,
+ cell_clip_param,
+ proj_clip_param
+).To([scratch_buffer, output_state_out, cell_state_out, output])
+
+input0 = {input_to_input_weights: [
+ 0.021393683, 0.06124551, 0.046905167, -0.014657677, -0.03149463,
+ 0.09171803, 0.14647801, 0.10797193, -0.0057968358, 0.0019193048,
+ -0.2726754, 0.10154029, -0.018539885, 0.080349885, -0.10262385,
+ -0.022599787, -0.09121155, -0.008675967, -0.045206103, -0.0821282,
+ -0.008045952, 0.015478081, 0.055217247, 0.038719587, 0.044153627,
+ -0.06453243, 0.05031825, -0.046935108, -0.008164439, 0.014574226,
+ -0.1671009, -0.15519552, -0.16819797, -0.13971269, -0.11953059,
+ 0.25005487, -0.22790983, 0.009855087, -0.028140958, -0.11200698,
+ 0.11295408, -0.0035217577, 0.054485075, 0.05184695, 0.064711206,
+ 0.10989193, 0.11674786, 0.03490607, 0.07727357, 0.11390585,
+ -0.1863375, -0.1034451, -0.13945189, -0.049401227, -0.18767063,
+ 0.042483903, 0.14233552, 0.13832581, 0.18350165, 0.14545603,
+ -0.028545704, 0.024939531, 0.050929718, 0.0076203286, -0.0029723682,
+ -0.042484224, -0.11827596, -0.09171104, -0.10808628, -0.16327988,
+ -0.2273378, -0.0993647, -0.017155107, 0.0023917493, 0.049272764,
+ 0.0038534778, 0.054764505, 0.089753784, 0.06947234, 0.08014476,
+ -0.04544234, -0.0497073, -0.07135631, -0.048929106, -0.004042012,
+ -0.009284026, 0.018042054, 0.0036860977, -0.07427302, -0.11434604,
+ -0.018995456, 0.031487543, 0.012834908, 0.019977754, 0.044256654,
+ -0.39292613, -0.18519334, -0.11651281, -0.06809892, 0.011373677],
+
+ input_to_forget_weights: [
+ -0.0018401089, -0.004852237, 0.03698424, 0.014181704, 0.028273236,
+ -0.016726194, -0.05249759, -0.10204261, 0.00861066, -0.040979505,
+ -0.009899187, 0.01923892, -0.028177269, -0.08535103, -0.14585495,
+ 0.10662567, -0.01909731, -0.017883534, -0.0047269356, -0.045103323,
+ 0.0030784295, 0.076784775, 0.07463696, 0.094531395, 0.0814421,
+ -0.12257899, -0.033945758, -0.031303465, 0.045630626, 0.06843887,
+ -0.13492945, -0.012480007, -0.0811829, -0.07224499, -0.09628791,
+ 0.045100946, 0.0012300825, 0.013964662, 0.099372394, 0.02543059,
+ 0.06958324, 0.034257296, 0.0482646, 0.06267997, 0.052625068,
+ 0.12784666, 0.07077897, 0.025725935, 0.04165009, 0.07241905,
+ 0.018668644, -0.037377294, -0.06277783, -0.08833636, -0.040120605,
+ -0.011405586, -0.007808335, -0.010301386, -0.005102167, 0.027717464,
+ 0.05483423, 0.11449111, 0.11289652, 0.10939839, 0.13396506,
+ -0.08402166, -0.01901462, -0.044678304, -0.07720565, 0.014350063,
+ -0.11757958, -0.0652038, -0.08185733, -0.076754324, -0.092614375,
+ 0.10405491, 0.052960336, 0.035755895, 0.035839386, -0.012540553,
+ 0.036881298, 0.02913376, 0.03420159, 0.05448447, -0.054523353,
+ 0.02582715, 0.02327355, -0.011857179, -0.0011980024, -0.034641717,
+ -0.026125094, -0.17582615, -0.15923657, -0.27486774, -0.0006143371,
+ 0.0001771948, -8.470171e-05, 0.02651807, 0.045790765, 0.06956496],
+
+ input_to_cell_weights: [
+ -0.04580283, -0.09549462, -0.032418985, -0.06454633,
+ -0.043528453, 0.043018587, -0.049152344, -0.12418144,
+ -0.078985475, -0.07596889, 0.019484362, -0.11434962,
+ -0.0074034138, -0.06314844, -0.092981495, 0.0062155537,
+ -0.025034338, -0.0028890965, 0.048929527, 0.06235075,
+ 0.10665918, -0.032036792, -0.08505916, -0.10843358,
+ -0.13002433, -0.036816437, -0.02130134, -0.016518239,
+ 0.0047691227, -0.0025825808, 0.066017866, 0.029991534,
+ -0.10652836, -0.1037554, -0.13056071, -0.03266643,
+ -0.033702414, -0.006473424, -0.04611692, 0.014419339,
+ -0.025174323, 0.0396852, 0.081777506, 0.06157468,
+ 0.10210095, -0.009658194, 0.046511717, 0.03603906,
+ 0.0069369148, 0.015960095, -0.06507666, 0.09551598,
+ 0.053568836, 0.06408714, 0.12835667, -0.008714329,
+ -0.20211966, -0.12093674, 0.029450472, 0.2849013,
+ -0.029227901, 0.1164364, -0.08560263, 0.09941786,
+ -0.036999565, -0.028842626, -0.0033637602, -0.017012902,
+ -0.09720865, -0.11193351, -0.029155117, -0.017936034,
+ -0.009768936, -0.04223324, -0.036159635, 0.06505112,
+ -0.021742892, -0.023377212, -0.07221364, -0.06430552,
+ 0.05453865, 0.091149814, 0.06387331, 0.007518393,
+ 0.055960953, 0.069779344, 0.046411168, 0.10509911,
+ 0.07463894, 0.0075130584, 0.012850982, 0.04555431,
+ 0.056955688, 0.06555285, 0.050801456, -0.009862683,
+ 0.00826772, -0.026555609, -0.0073611983, -0.0014897042],
+
+ input_to_output_weights: [
+ -0.0998932, -0.07201956, -0.052803773, -0.15629593, -0.15001918,
+ -0.07650751, 0.02359855, -0.075155355, -0.08037709, -0.15093534,
+ 0.029517552, -0.04751393, 0.010350531, -0.02664851, -0.016839722,
+ -0.023121163, 0.0077019283, 0.012851257, -0.05040649, -0.0129761,
+ -0.021737747, -0.038305793, -0.06870586, -0.01481247, -0.001285394,
+ 0.10124236, 0.083122835, 0.053313006, -0.062235646, -0.075637154,
+ -0.027833903, 0.029774971, 0.1130802, 0.09218906, 0.09506135,
+ -0.086665764, -0.037162706, -0.038880914, -0.035832845, -0.014481564,
+ -0.09825003, -0.12048569, -0.097665586, -0.05287633, -0.0964047,
+ -0.11366429, 0.035777505, 0.13568819, 0.052451383, 0.050649304,
+ 0.05798951, -0.021852335, -0.099848844, 0.014740475, -0.078897946,
+ 0.04974699, 0.014160473, 0.06973932, 0.04964942, 0.033364646,
+ 0.08190124, 0.025535367, 0.050893165, 0.048514254, 0.06945813,
+ -0.078907564, -0.06707616, -0.11844508, -0.09986688, -0.07509403,
+ 0.06263226, 0.14925587, 0.20188436, 0.12098451, 0.14639415,
+ 0.0015017595, -0.014267382, -0.03417257, 0.012711468, 0.0028300495,
+ -0.024758482, -0.05098548, -0.0821182, 0.014225672, 0.021544158,
+ 0.08949725, 0.07505268, -0.0020780868, 0.04908258, 0.06476295,
+ -0.022907063, 0.027562456, 0.040185735, 0.019567577, -0.015598739,
+ -0.049097303, -0.017121866, -0.083368234, -0.02332002, -0.0840956],
+
+ input_gate_bias: [
+ 0.02234832, 0.14757581, 0.18176508, 0.10380666, 0.053110216,
+ -0.06928846, -0.13942584, -0.11816189, 0.19483899, 0.03652339,
+ -0.10250295, 0.036714908, -0.18426876, 0.036065217, 0.21810818,
+ 0.02383196, -0.043370757, 0.08690144, -0.04444982, 0.00030581196],
+
+ forget_gate_bias: [
+ 0.035185695, -0.042891346, -0.03032477, 0.23027696,
+ 0.11098921, 0.15378423, 0.09263801, 0.09790885,
+ 0.09508917, 0.061199076, 0.07665568, -0.015443159,
+ -0.03499149, 0.046190713, 0.08895977, 0.10899629,
+ 0.40694186, 0.06030037, 0.012413437, -0.06108739],
+
+ cell_gate_bias: [
+ -0.024379363, 0.0055531194, 0.23377132, 0.033463873,
+ -0.1483596, -0.10639995, -0.091433935, 0.058573797,
+ -0.06809782, -0.07889636, -0.043246906, -0.09829136,
+ -0.4279842, 0.034901652, 0.18797937, 0.0075234566,
+ 0.016178843, 0.1749513, 0.13975595, 0.92058027],
+
+ output_gate_bias: [
+ 0.046159424, -0.0012809046, 0.03563469, 0.12648113, 0.027195795,
+ 0.35373217, -0.018957434, 0.008907322, -0.0762701, 0.12018895,
+ 0.04216877, 0.0022856654, 0.040952638, 0.3147856, 0.08225149,
+ -0.057416286, -0.14995944, -0.008040261, 0.13208859, 0.029760877],
+
+ recurrent_to_input_weights: [
+ -0.001374326, -0.078856036, 0.10672688, 0.029162422,
+ -0.11585556, 0.02557986, -0.13446963, -0.035785314,
+ -0.01244275, 0.025961924, -0.02337298, -0.044228926,
+ -0.055839065, -0.046598054, -0.010546039, -0.06900766,
+ 0.027239809, 0.022582639, -0.013296484, -0.05459212,
+ 0.08981, -0.045407712, 0.08682226, -0.06867011,
+ -0.14390695, -0.02916037, 0.000996957, 0.091420636,
+ 0.14283475, -0.07390571, -0.06402044, 0.062524505,
+ -0.093129106, 0.04860203, -0.08364217, -0.08119002,
+ 0.009352075, 0.22920375, 0.0016303885, 0.11583097,
+ -0.13732095, 0.012405723, -0.07551853, 0.06343048,
+ 0.12162708, -0.031923793, -0.014335606, 0.01790974,
+ -0.10650317, -0.0724401, 0.08554849, -0.05727212,
+ 0.06556731, -0.042729504, -0.043227166, 0.011683251,
+ -0.013082158, -0.029302018, -0.010899579, -0.062036745,
+ -0.022509435, -0.00964907, -0.01567329, 0.04260106,
+ -0.07787477, -0.11576462, 0.017356863, 0.048673786,
+ -0.017577527, -0.05527947, -0.082487635, -0.040137455,
+ -0.10820036, -0.04666372, 0.022746278, -0.07851417,
+ 0.01068115, 0.032956902, 0.022433773, 0.0026891115,
+ 0.08944216, -0.0685835, 0.010513544, 0.07228705,
+ 0.02032331, -0.059686817, -0.0005566496, -0.086984694,
+ 0.040414046, -0.1380399, 0.094208956, -0.05722982,
+ 0.012092817, -0.04989123, -0.086576, -0.003399834,
+ -0.04696032, -0.045747425, 0.10091314, 0.048676282,
+ -0.029037097, 0.031399418, -0.0040285117, 0.047237843,
+ 0.09504992, 0.041799378, -0.049185462, -0.031518843,
+ -0.10516937, 0.026374253, 0.10058866, -0.0033195973,
+ -0.041975245, 0.0073591834, 0.0033782164, -0.004325073,
+ -0.10167381, 0.042500053, -0.01447153, 0.06464186,
+ -0.017142897, 0.03312627, 0.009205989, 0.024138335,
+ -0.011337001, 0.035530265, -0.010912711, 0.0706555,
+ -0.005894094, 0.051841937, -0.1401738, -0.02351249,
+ 0.0365468, 0.07590991, 0.08838724, 0.021681072,
+ -0.10086113, 0.019608743, -0.06195883, 0.077335775,
+ 0.023646897, -0.095322326, 0.02233014, 0.09756986,
+ -0.048691444, -0.009579111, 0.07595467, 0.11480546,
+ -0.09801813, 0.019894179, 0.08502348, 0.004032281,
+ 0.037211012, 0.068537936, -0.048005626, -0.091520436,
+ -0.028379958, -0.01556313, 0.06554592, -0.045599163,
+ -0.01672207, -0.020169014, -0.011877351, -0.20212261,
+ 0.010889619, 0.0047078193, 0.038385306, 0.08540671,
+ -0.017140968, -0.0035865551, 0.016678626, 0.005633034,
+ 0.015963363, 0.00871737, 0.060130805, 0.028611384,
+ 0.10109069, -0.015060172, -0.07894427, 0.06401885,
+ 0.011584063, -0.024466386, 0.0047652307, -0.09041358,
+ 0.030737216, -0.0046374933, 0.14215417, -0.11823516,
+ 0.019899689, 0.006106124, -0.027092824, 0.0786356,
+ 0.05052217, -0.058925, -0.011402121, -0.024987547,
+ -0.0013661642, -0.06832946, -0.015667673, -0.1083353,
+ -0.00096863037, -0.06988685, -0.053350925, -0.027275559,
+ -0.033664223, -0.07978348, -0.025200296, -0.017207067,
+ -0.058403496, -0.055697463, 0.005798788, 0.12965427,
+ -0.062582195, 0.0013350133, -0.10482091, 0.0379771,
+ 0.072521195, -0.0029455067, -0.13797039, -0.03628521,
+ 0.013806405, -0.017858358, -0.01008298, -0.07700066,
+ -0.017081132, 0.019358726, 0.0027079724, 0.004635139,
+ 0.062634714, -0.02338735, -0.039547626, -0.02050681,
+ 0.03385117, -0.083611414, 0.002862572, -0.09421313,
+ 0.058618143, -0.08598433, 0.00972939, 0.023867095,
+ -0.053934585, -0.023203006, 0.07452513, -0.048767887,
+ -0.07314807, -0.056307215, -0.10433547, -0.06440842,
+ 0.04328182, 0.04389765, -0.020006588, -0.09076438,
+ -0.11652589, -0.021705797, 0.03345259, -0.010329105,
+ -0.025767034, 0.013057034, -0.07316461, -0.10145612,
+ 0.06358255, 0.18531723, 0.07759293, 0.12006465,
+ 0.1305557, 0.058638252, -0.03393652, 0.09622831,
+ -0.16253184, -2.4580743e-06, 0.079869635, -0.070196845,
+ -0.005644518, 0.06857898, -0.12598175, -0.035084512,
+ 0.03156317, -0.12794146, -0.031963028, 0.04692781,
+ 0.030070418, 0.0071660685, -0.095516115, -0.004643372,
+ 0.040170413, -0.062104587, -0.0037324072, 0.0554317,
+ 0.08184801, -0.019164372, 0.06791302, 0.034257166,
+ -0.10307039, 0.021943003, 0.046745934, 0.0790918,
+ -0.0265588, -0.007824208, 0.042546265, -0.00977924,
+ -0.0002440307, -0.017384544, -0.017990116, 0.12252321,
+ -0.014512694, -0.08251313, 0.08861942, 0.13589665,
+ 0.026351685, 0.012641483, 0.07466548, 0.044301085,
+ -0.045414884, -0.051112458, 0.03444247, -0.08502782,
+ -0.04106223, -0.028126027, 0.028473156, 0.10467447],
+
+ recurrent_to_forget_weights: [
+ -0.057784554, -0.026057621, -0.068447545, -0.022581743,
+ 0.14811787, 0.10826372, 0.09471067, 0.03987225,
+ -0.0039523416, 0.00030638507, 0.053185795, 0.10572994,
+ 0.08414449, -0.022036452, -0.00066928595, -0.09203576,
+ 0.032950465, -0.10985798, -0.023809856, 0.0021431844,
+ -0.02196096, -0.00326074, 0.00058621005, -0.074678116,
+ -0.06193199, 0.055729095, 0.03736828, 0.020123724,
+ 0.061878487, -0.04729229, 0.034919553, -0.07585433,
+ -0.04421272, -0.044019096, 0.085488975, 0.04058006,
+ -0.06890133, -0.030951202, -0.024628663, -0.07672815,
+ 0.034293607, 0.08556707, -0.05293577, -0.033561368,
+ -0.04899627, 0.0241671, 0.015736353, -0.095442444,
+ -0.029564252, 0.016493602, -0.035026584, 0.022337519,
+ -0.026871363, 0.004780428, 0.0077918363, -0.03601621,
+ 0.016435321, -0.03263031, -0.09543275, -0.047392778,
+ 0.013454138, 0.028934088, 0.01685226, -0.086110644,
+ -0.046250615, -0.01847454, 0.047608484, 0.07339695,
+ 0.034546845, -0.04881143, 0.009128804, -0.08802852,
+ 0.03761666, 0.008096139, -0.014454086, 0.014361001,
+ -0.023502491, -0.0011840804, -0.07607001, 0.001856849,
+ -0.06509276, -0.006021153, -0.08570962, -0.1451793,
+ 0.060212336, 0.055259194, 0.06974018, 0.049454916,
+ -0.027794661, -0.08077226, -0.016179763, 0.1169753,
+ 0.17213494, -0.0056326236, -0.053934924, -0.0124349,
+ -0.11520337, 0.05409887, 0.088759385, 0.0019655675,
+ 0.0042065294, 0.03881498, 0.019844765, 0.041858196,
+ -0.05695512, 0.047233116, 0.038937137, -0.06542224,
+ 0.014429736, -0.09719407, 0.13908425, -0.05379757,
+ 0.012321099, 0.082840554, -0.029899208, 0.044217527,
+ 0.059855383, 0.07711018, -0.045319796, 0.0948846,
+ -0.011724666, -0.0033288454, -0.033542685, -0.04764985,
+ -0.13873616, 0.040668588, 0.034832682, -0.015319203,
+ -0.018715994, 0.046002675, 0.0599172, -0.043107376,
+ 0.0294216, -0.002314414, -0.022424703, 0.0030315618,
+ 0.0014641669, 0.0029166266, -0.11878115, 0.013738511,
+ 0.12375372, -0.0006038222, 0.029104086, 0.087442465,
+ 0.052958444, 0.07558703, 0.04817258, 0.044462286,
+ -0.015213451, -0.08783778, -0.0561384, -0.003008196,
+ 0.047060397, -0.002058388, 0.03429439, -0.018839769,
+ 0.024734668, 0.024614193, -0.042046934, 0.09597743,
+ -0.0043254104, 0.04320769, 0.0064070094, -0.0019131786,
+ -0.02558259, -0.022822596, -0.023273505, -0.02464396,
+ -0.10991725, -0.006240552, 0.0074488563, 0.024044557,
+ 0.04383914, -0.046476185, 0.028658995, 0.060410924,
+ 0.050786525, 0.009452605, -0.0073054377, -0.024810238,
+ 0.0052906186, 0.0066939713, -0.0020913032, 0.014515517,
+ 0.015898481, 0.021362653, -0.030262267, 0.016587038,
+ -0.011442813, 0.041154444, -0.007631438, -0.03423484,
+ -0.010977775, 0.036152758, 0.0066366293, 0.11915515,
+ 0.02318443, -0.041350313, 0.021485701, -0.10906167,
+ -0.028218046, -0.00954771, 0.020531068, -0.11995105,
+ -0.03672871, 0.024019798, 0.014255957, -0.05221243,
+ -0.00661567, -0.04630967, 0.033188973, 0.10107534,
+ -0.014027541, 0.030796422, -0.10270911, -0.035999842,
+ 0.15443139, 0.07684145, 0.036571592, -0.035900835,
+ -0.0034699554, 0.06209149, 0.015920248, -0.031122351,
+ -0.03858649, 0.01849943, 0.13872518, 0.01503974,
+ 0.069941424, -0.06948533, -0.0088794185, 0.061282158,
+ -0.047401894, 0.03100163, -0.041533746, -0.10430945,
+ 0.044574402, -0.01425562, -0.024290353, 0.034563623,
+ 0.05866852, 0.023947537, -0.09445152, 0.035450947,
+ 0.02247216, -0.0042998926, 0.061146557, -0.10250651,
+ 0.020881841, -0.06747029, 0.10062043, -0.0023941975,
+ 0.03532124, -0.016341697, 0.09685456, -0.016764693,
+ 0.051808182, 0.05875331, -0.04536488, 0.001626336,
+ -0.028892258, -0.01048663, -0.009793449, -0.017093895,
+ 0.010987891, 0.02357273, -0.00010856845, 0.0099760275,
+ -0.001845119, -0.03551521, 0.0018358806, 0.05763657,
+ -0.01769146, 0.040995963, 0.02235177, -0.060430344,
+ 0.11475477, -0.023854522, 0.10071741, 0.0686208,
+ -0.014250481, 0.034261297, 0.047418304, 0.08562733,
+ -0.030519066, 0.0060542435, 0.014653856, -0.038836084,
+ 0.04096551, 0.032249358, -0.08355519, -0.026823482,
+ 0.056386515, -0.010401743, -0.028396193, 0.08507674,
+ 0.014410365, 0.020995233, 0.17040324, 0.11511526,
+ 0.02459721, 0.0066619175, 0.025853224, -0.023133837,
+ -0.081302024, 0.017264642, -0.009585969, 0.09491168,
+ -0.051313367, 0.054532815, -0.014298593, 0.10657464,
+ 0.007076659, 0.10964551, 0.0409152, 0.008275321,
+ -0.07283536, 0.07937492, 0.04192024, -0.1075027],
+
+ recurrent_to_cell_weights: [
+ -0.037322544, 0.018592842, 0.0056175636, -0.06253426,
+ 0.055647098, -0.05713207, -0.05626563, 0.005559383,
+ 0.03375411, -0.025757805, -0.088049285, 0.06017052,
+ -0.06570978, 0.007384076, 0.035123326, -0.07920549,
+ 0.053676967, 0.044480428, -0.07663568, 0.0071805613,
+ 0.08089997, 0.05143358, 0.038261272, 0.03339287,
+ -0.027673481, 0.044746667, 0.028349208, 0.020090483,
+ -0.019443132, -0.030755889, -0.0040000007, 0.04465846,
+ -0.021585021, 0.0031670958, 0.0053199246, -0.056117613,
+ -0.10893326, 0.076739706, -0.08509834, -0.027997585,
+ 0.037871376, 0.01449768, -0.09002357, -0.06111149,
+ -0.046195522, 0.0422062, -0.005683705, -0.1253618,
+ -0.012925729, -0.04890792, 0.06985068, 0.037654128,
+ 0.03398274, -0.004781977, 0.007032333, -0.031787455,
+ 0.010868644, -0.031489216, 0.09525667, 0.013939797,
+ 0.0058680447, 0.0167067, 0.02668468, -0.04797466,
+ -0.048885044, -0.12722108, 0.035304096, 0.06554885,
+ 0.00972396, -0.039238118, -0.05159735, -0.11329045,
+ 0.1613692, -0.03750952, 0.06529313, -0.071974665,
+ -0.11769596, 0.015524369, -0.0013754242, -0.12446318,
+ 0.02786344, -0.014179351, 0.005264273, 0.14376344,
+ 0.015983658, 0.03406988, -0.06939408, 0.040699873,
+ 0.02111075, 0.09669095, 0.041345075, -0.08316494,
+ -0.07684199, -0.045768797, 0.032298047, -0.041805092,
+ 0.0119405, 0.0061010392, 0.12652606, 0.0064572375,
+ -0.024950314, 0.11574242, 0.04508852, -0.04335324,
+ 0.06760663, -0.027437469, 0.07216407, 0.06977076,
+ -0.05438599, 0.034033038, -0.028602652, 0.05346137,
+ 0.043184172, -0.037189785, 0.10420091, 0.00882477,
+ -0.054019816, -0.074273005, -0.030617684, -0.0028467078,
+ 0.024302477, -0.0038869337, 0.005332455, 0.0013399826,
+ 0.04361412, -0.007001822, 0.09631092, -0.06702025,
+ -0.042049985, -0.035070654, -0.04103342, -0.10273396,
+ 0.0544271, 0.037184782, -0.13150354, -0.0058036847,
+ -0.008264958, 0.042035464, 0.05891794, 0.029673764,
+ 0.0063542654, 0.044788733, 0.054816857, 0.062257513,
+ -0.00093483756, 0.048938446, -0.004952862, -0.007730018,
+ -0.04043371, -0.017094059, 0.07229206, -0.023670016,
+ -0.052195564, -0.025616996, -0.01520939, 0.045104615,
+ -0.007376126, 0.003533447, 0.006570588, 0.056037236,
+ 0.12436656, 0.051817212, 0.028532185, -0.08686856,
+ 0.11868599, 0.07663395, -0.07323171, 0.03463402,
+ -0.050708205, -0.04458982, -0.11590894, 0.021273347,
+ 0.1251325, -0.15313013, -0.12224372, 0.17228661,
+ 0.023029093, 0.086124025, 0.006445803, -0.03496501,
+ 0.028332196, 0.04449512, -0.042436164, -0.026587414,
+ -0.006041347, -0.09292539, -0.05678812, 0.03897832,
+ 0.09465633, 0.008115513, -0.02171956, 0.08304309,
+ 0.071401566, 0.019622514, 0.032163795, -0.004167056,
+ 0.02295182, 0.030739572, 0.056506045, 0.004612461,
+ 0.06524936, 0.059999723, 0.046395954, -0.0045512207,
+ -0.1335546, -0.030136576, 0.11584653, -0.014678886,
+ 0.0020118146, -0.09688814, -0.0790206, 0.039770417,
+ -0.0329582, 0.07922767, 0.029322514, 0.026405897,
+ 0.04207835, -0.07073373, 0.063781224, 0.0859677,
+ -0.10925287, -0.07011058, 0.048005477, 0.03438226,
+ -0.09606514, -0.006669445, -0.043381985, 0.04240257,
+ -0.06955775, -0.06769346, 0.043903265, -0.026784198,
+ -0.017840602, 0.024307009, -0.040079936, -0.019946516,
+ 0.045318738, -0.12233574, 0.026170589, 0.0074471775,
+ 0.15978073, 0.10185836, 0.10298046, -0.015476589,
+ -0.039390966, -0.072174534, 0.0739445, -0.1211869,
+ -0.0347889, -0.07943156, 0.014809798, -0.12412325,
+ -0.0030663363, 0.039695457, 0.0647603, -0.08291318,
+ -0.018529687, -0.004423833, 0.0037507233, 0.084633216,
+ -0.01514876, -0.056505352, -0.012800942, -0.06994386,
+ 0.012962922, -0.031234352, 0.07029052, 0.016418684,
+ 0.03618972, 0.055686004, -0.08663945, -0.017404709,
+ -0.054761406, 0.029065743, 0.052404847, 0.020238016,
+ 0.0048197987, -0.0214882, 0.07078733, 0.013016777,
+ 0.06262858, 0.009184685, 0.020785125, -0.043904778,
+ -0.0270329, -0.03299152, -0.060088247, -0.015162964,
+ -0.001828936, 0.12642565, -0.056757294, 0.013586685,
+ 0.09232601, -0.035886683, 0.06000002, 0.05229691,
+ -0.052580316, -0.082029596, -0.010794592, 0.012947712,
+ -0.036429964, -0.085508935, -0.13127148, -0.017744139,
+ 0.031502828, 0.036232427, -0.031581745, 0.023051167,
+ -0.05325106, -0.03421577, 0.028793324, -0.034633752,
+ -0.009881397, -0.043551125, -0.018609839, 0.0019097115,
+ -0.008799762, 0.056595087, 0.0022273948, 0.055752404],
+
+ recurrent_to_output_weights: [
+ 0.025825322, -0.05813119, 0.09495884, -0.045984812, -0.01255415,
+ -0.0026479573, -0.08196161, -0.054914974, -0.0046604523, -0.029587349,
+ -0.044576716, -0.07480124, -0.082868785, 0.023254942, 0.027502948,
+ -0.0039728214, -0.08683098, -0.08116779, -0.014675607, -0.037924774,
+ -0.023314456, -0.007401714, -0.09255757, 0.029460307, -0.08829125,
+ -0.005139627, -0.08989442, -0.0555066, 0.13596267, -0.025062224,
+ -0.048351806, -0.03850004, 0.07266485, -0.022414139, 0.05940088,
+ 0.075114764, 0.09597592, -0.010211725, -0.0049794707, -0.011523867,
+ -0.025980417, 0.072999895, 0.11091378, -0.081685916, 0.014416728,
+ 0.043229222, 0.034178585, -0.07530371, 0.035837382, -0.085607,
+ -0.007721233, -0.03287832, -0.043848954, -0.06404588, -0.06632928,
+ -0.073643476, 0.008214239, -0.045984086, 0.039764922, 0.03474462,
+ 0.060612556, -0.080590084, 0.049127717, 0.04151091, -0.030063879,
+ 0.008801774, -0.023021035, -0.019558564, 0.05158114, -0.010947698,
+ -0.011825728, 0.0075720972, 0.0699727, -0.0039981045, 0.069350146,
+ 0.08799282, 0.016156472, 0.035502106, 0.11695009, 0.006217345,
+ 0.13392477, -0.037875112, 0.025745004, 0.08940699, -0.00924166,
+ 0.0046702605, -0.036598757, -0.08811812, 0.10522024, -0.032441203,
+ 0.008176899, -0.04454919, 0.07058152, 0.0067963637, 0.039206743,
+ 0.03259838, 0.03725492, -0.09515802, 0.013326398, -0.052055415,
+ -0.025676316, 0.03198509, -0.015951829, -0.058556724, 0.036879618,
+ 0.043357447, 0.028362012, -0.05908629, 0.0059240665, -0.04995891,
+ -0.019187413, 0.0276265, -0.01628143, 0.0025863599, 0.08800015,
+ 0.035250366, -0.022165963, -0.07328642, -0.009415526, -0.07455109,
+ 0.11690406, 0.0363299, 0.07411125, 0.042103454, -0.009660886,
+ 0.019076364, 0.018299393, -0.046004917, 0.08891175, 0.0431396,
+ -0.026327137, -0.051502608, 0.08979574, -0.051670972, 0.04940282,
+ -0.07491107, -0.021240504, 0.022596184, -0.034280192, 0.060163025,
+ -0.058211457, -0.051837247, -0.01349775, -0.04639988, -0.035936575,
+ -0.011681591, 0.064818054, 0.0073146066, -0.021745546, -0.043124277,
+ -0.06471268, -0.07053354, -0.029321948, -0.05330136, 0.016933719,
+ -0.053782392, 0.13747959, -0.1361751, -0.11569455, 0.0033329215,
+ 0.05693899, -0.053219706, 0.063698, 0.07977434, -0.07924483,
+ 0.06936997, 0.0034815092, -0.007305279, -0.037325785, -0.07251102,
+ -0.033633437, -0.08677009, 0.091591336, -0.14165086, 0.021752775,
+ 0.019683983, 0.0011612234, -0.058154266, 0.049996935, 0.0288841,
+ -0.0024567875, -0.14345716, 0.010955264, -0.10234828, 0.1183656,
+ -0.0010731248, -0.023590032, -0.072285876, -0.0724771, -0.026382286,
+ -0.0014920527, 0.042667855, 0.0018776858, 0.02986552, 0.009814309,
+ 0.0733756, 0.12289186, 0.018043943, -0.0458958, 0.049412545,
+ 0.033632483, 0.05495232, 0.036686596, -0.013781798, -0.010036754,
+ 0.02576849, -0.08307328, 0.010112348, 0.042521734, -0.05869831,
+ -0.071689695, 0.03876447, -0.13275425, -0.0352966, -0.023077697,
+ 0.10285965, 0.084736146, 0.15568255, -0.00040734606, 0.027835453,
+ -0.10292561, -0.032401145, 0.10053256, -0.026142767, -0.08271222,
+ -0.0030240538, -0.016368777, 0.1070414, 0.042672627, 0.013456989,
+ -0.0437609, -0.022309763, 0.11576483, 0.04108048, 0.061026827,
+ -0.0190714, -0.0869359, 0.037901703, 0.0610107, 0.07202949,
+ 0.01675338, 0.086139716, -0.08795751, -0.014898893, -0.023771819,
+ -0.01965048, 0.007955471, -0.043740474, 0.03346837, -0.10549954,
+ 0.090567775, 0.042013682, -0.03176985, 0.12569028, -0.02421228,
+ -0.029526481, 0.023851605, 0.031539805, 0.05292009, -0.02344001,
+ -0.07811758, -0.08834428, 0.10094801, 0.16594367, -0.06861939,
+ -0.021256343, -0.041093912, -0.06669611, 0.035498552, 0.021757556,
+ -0.09302526, -0.015403468, -0.06614931, -0.051798206, -0.013874718,
+ 0.03630673, 0.010412845, -0.08077351, 0.046185967, 0.0035662893,
+ 0.03541868, -0.094149634, -0.034814864, 0.003128424, -0.020674974,
+ -0.03944324, -0.008110165, -0.11113267, 0.08484226, 0.043586485,
+ 0.040582247, 0.0968012, -0.065249965, -0.028036479, 0.0050708856,
+ 0.0017462453, 0.0326779, 0.041296225, 0.09164146, -0.047743853,
+ -0.015952192, -0.034451712, 0.084197424, -0.05347844, -0.11768019,
+ 0.085926116, -0.08251791, -0.045081906, 0.0948852, 0.068401024,
+ 0.024856757, 0.06978981, -0.057309967, -0.012775832, -0.0032452994,
+ 0.01977615, -0.041040014, -0.024264973, 0.063464895, 0.05431621],
+
+ cell_to_input_weights: [
+ 0.040369894, 0.030746894, 0.24704495, 0.018586371, -0.037586458,
+ -0.15312155, -0.11812848, -0.11465643, 0.20259799, 0.11418174,
+ -0.10116027, -0.011334949, 0.12411352, -0.076769054, -0.052169047,
+ 0.21198851, -0.38871562, -0.09061183, -0.09683246, -0.21929175],
+
+ cell_to_forget_weights: [
+ -0.01998659, -0.15568835, -0.24248174, -0.012770197, 0.041331276,
+ -0.072311886, -0.052123554, -0.0066330447, -0.043891653, 0.036225766,
+ -0.047248036, 0.021479502, 0.033189066, 0.11952997, -0.020432774,
+ 0.64658105, -0.06650122, -0.03467612, 0.095340036, 0.23647355],
+
+ cell_to_output_weights: [
+ 0.08286371, -0.08261836, -0.51210177, 0.002913762, 0.17764764,
+ -0.5495371, -0.08460716, -0.24552552, 0.030037103, 0.04123544,
+ -0.11940523, 0.007358328, 0.1890978, 0.4833202, -0.34441817,
+ 0.36312827, -0.26375428, 0.1457655, -0.19724406, 0.15548733],
+
+ projection_weights: [
+ -0.009802181, 0.09401916, 0.0717386, -0.13895074, 0.09641832,
+ 0.060420845, 0.08539281, 0.054285463, 0.061395317, 0.034448683,
+ -0.042991187, 0.019801661, -0.16840284, -0.015726732, -0.23041931,
+ -0.024478018, -0.10959692, -0.013875541, 0.18600968, -0.061274476,
+ 0.0138165, -0.08160894, -0.07661644, 0.032372914, 0.16169067,
+ 0.22465782, -0.03993472, -0.004017731, 0.08633481, -0.28869787,
+ 0.08682067, 0.17240396, 0.014975425, 0.056431185, 0.031037588,
+ 0.16702051, 0.0077946745, 0.15140012, 0.29405436, 0.120285,
+ -0.188994, -0.027265169, 0.043389652, -0.022061434, 0.014777949,
+ -0.20203483, 0.094781205, 0.19100232, 0.13987629, -0.036132768,
+ -0.06426278, -0.05108664, 0.13221376, 0.009441198, -0.16715929,
+ 0.15859416, -0.040437475, 0.050779544, -0.022187516, 0.012166504,
+ 0.027685808, -0.07675938, -0.0055694645, -0.09444123, 0.0046453946,
+ 0.050794356, 0.10770313, -0.20790008, -0.07149004, -0.11425117,
+ 0.008225835, -0.035802525, 0.14374903, 0.15262283, 0.048710253,
+ 0.1847461, -0.007487823, 0.11000021, -0.09542012, 0.22619456,
+ -0.029149994, 0.08527916, 0.009043713, 0.0042746216, 0.016261552,
+ 0.022461696, 0.12689082, -0.043589946, -0.12035478, -0.08361797,
+ -0.050666027, -0.1248618, -0.1275799, -0.071875185, 0.07377272,
+ 0.09944291, -0.18897448, -0.1593054, -0.06526116, -0.040107165,
+ -0.004618631, -0.067624845, -0.007576253, 0.10727444, 0.041546922,
+ -0.20424393, 0.06907816, 0.050412357, 0.00724631, 0.039827548,
+ 0.12449835, 0.10747581, 0.13708383, 0.09134148, -0.12617786,
+ -0.06428341, 0.09956831, 0.1208086, -0.14676677, -0.0727722,
+ 0.1126304, 0.010139365, 0.015571211, -0.038128063, 0.022913318,
+ -0.042050496, 0.16842307, -0.060597885, 0.10531834, -0.06411776,
+ -0.07451711, -0.03410368, -0.13393489, 0.06534304, 0.003620307,
+ 0.04490757, 0.05970546, 0.05197996, 0.02839995, 0.10434969,
+ -0.013699693, -0.028353551, -0.07260381, 0.047201227, -0.024575593,
+ -0.036445823, 0.07155557, 0.009672501, -0.02328883, 0.009533515,
+ -0.03606021, -0.07421458, -0.028082801, -0.2678904, -0.13221288,
+ 0.18419984, -0.13012612, -0.014588381, -0.035059117, -0.04824723,
+ 0.07830115, -0.056184657, 0.03277091, 0.025466874, 0.14494097,
+ -0.12522776, -0.098633975, -0.10766018, -0.08317623, 0.08594209,
+ 0.07749552, 0.039474737, 0.1776665, -0.07409566, -0.0477268,
+ 0.29323658, 0.10801441, 0.1154011, 0.013952499, 0.10739139,
+ 0.10708251, -0.051456142, 0.0074137426, -0.10430189, 0.10034707,
+ 0.045594677, 0.0635285, -0.0715442, -0.089667566, -0.10811871,
+ 0.00026344223, 0.08298446, -0.009525053, 0.006585689, -0.24567553,
+ -0.09450807, 0.09648481, 0.026996298, -0.06419476, -0.04752702,
+ -0.11063944, -0.23441927, -0.17608605, -0.052156363, 0.067035615,
+ 0.19271925, -0.0032889997, -0.043264326, 0.09663576, -0.057112187,
+ -0.10100678, 0.0628376, 0.04447668, 0.017961001, -0.10094388,
+ -0.10190601, 0.18335468, 0.10494553, -0.052095775, -0.0026118709,
+ 0.10539724, -0.04383912, -0.042349473, 0.08438151, -0.1947263,
+ 0.02251204, 0.11216432, -0.10307853, 0.17351969, -0.039091777,
+ 0.08066188, -0.00561982, 0.12633002, 0.11335965, -0.0088127935,
+ -0.019777594, 0.06864014, -0.059751723, 0.016233567, -0.06894641,
+ -0.28651384, -0.004228674, 0.019708522, -0.16305895, -0.07468996,
+ -0.0855457, 0.099339016, -0.07580735, -0.13775392, 0.08434318,
+ 0.08330512, -0.12131499, 0.031935584, 0.09180414, -0.08876437,
+ -0.08049874, 0.008753825, 0.03498998, 0.030215185, 0.03907079,
+ 0.089751154, 0.029194152, -0.03337423, -0.019092513, 0.04331237,
+ 0.04299654, -0.036394123, -0.12915532, 0.09793732, 0.07512415,
+ -0.11319543, -0.032502122, 0.15661901, 0.07671967, -0.005491124,
+ -0.19379048, -0.218606, 0.21448623, 0.017840758, 0.1416943,
+ -0.07051762, 0.19488361, 0.02664691, -0.18104725, -0.09334311,
+ 0.15026465, -0.15493552, -0.057762887, -0.11604192, -0.262013,
+ -0.01391798, 0.012185008, 0.11156489, -0.07483202, 0.06693364,
+ -0.26151478, 0.046425626, 0.036540434, -0.16435726, 0.17338543,
+ -0.21401681, -0.11385144, -0.08283257, -0.069031075, 0.030635102,
+ 0.010969227, 0.11109743, 0.010919218, 0.027526086, 0.13519906,
+ 0.01891392, -0.046839405, -0.040167913, 0.017953383, -0.09700955,
+ 0.0061885654, -0.07000971, 0.026893595, -0.038844477, 0.14543656],
+
+ projection_bias: [],
+
+ activation_param: [4], # Tanh
+ cell_clip_param: [0.],
+ proj_clip_param: [0.],
+}
+
+# Batch0: 4 (input_sequence_size) * 5 (n_input)
+input0[input] = [0.867394, 0.291279, 0.013714, 0.482521, 0.626339]
+# Batch1: 4 (input_sequence_size) * 5 (n_input)
+input0[input].extend(
+ [0.082922, 0.563329, 0.865614, 0.333232, 0.259916]
+)
+input0[output_state_in] = [
+ -0.0213783, 0.0350169, 0.000324787, 0.0276012,
+ -0.0263374, -0.0371449, 0.0446149, -0.0205474,
+ 0.0103729, -0.0576349, -0.0150052, -0.0292043,
+ 0.0376827, 0.0136115, 0.0243435, 0.0354492,
+ -0.0204549, 0.0450315, -0.00117379, 0.0167673,
+ -0.0375007, -0.0238314, 0.038784, -0.0174034,
+ 0.0131743, -0.0506589, -0.00484469, -0.0240239,
+ 0.0325789, 0.00790064, 0.0220157, 0.0333314,
+]
+input0[cell_state_in] = [
+ -0.126572, -0.121882, 0.121569, 0.0489971,
+ -0.240177, -0.124685, -0.122565, 0.0162748,
+ 0.0317536, -0.0270355, 0.0418199, -0.179755,
+ -0.327279, -0.0342741, 0.133831, -0.0238279,
+ 0.122148, 0.269115, 0.185989, 0.525976,
+ -0.167208, -0.109612, 0.0531226, 0.0695387,
+ -0.248335, -0.134123, -0.108246, 0.00628498,
+ 0.0492984, -0.0264919, 0.0698144, -0.0635602,
+ -0.295363, -0.0760078, 0.102725, -0.0351708,
+ 0.149804, 0.259131, 0.202573, 0.500664,
+]
+output0 = {
+ scratch_buffer: [ 0 for x in range(n_batch * n_cell * 4) ],
+ cell_state_out: [ 0 for x in range(n_batch * n_cell) ],
+ output_state_out: [ 0 for x in range(n_batch * n_output) ],
+}
+
+# Batch0: 4 (input_sequence_size) * 16 (n_output)
+output0[output] = [
+ -0.0189322, 0.0464512, -0.00251373, 0.0225745,
+ -0.0308346, -0.0317124, 0.0460407, -0.0189395,
+ 0.0149363, -0.0530162, -0.0150767, -0.0340193,
+ 0.0286833, 0.00824207, 0.0264887, 0.0305169]
+# Batch1: 4 (input_sequence_size) * 16 (n_output)
+output0[output].extend(
+ [-0.0264787, 0.0387855, -0.000764675, 0.0217599,
+ -0.037537, -0.0335206, 0.0431679, -0.0211424,
+ 0.010203, -0.062785, -0.00832363, -0.025181,
+ 0.0412031, 0.0118723, 0.0239643, 0.0394009]
+ )
+
+Example((input0, output0))
diff --git a/nn/runtime/test/specs/lstm_state.mod.py b/nn/runtime/test/specs/lstm_state.mod.py
new file mode 100644
index 000000000..8862f1063
--- /dev/null
+++ b/nn/runtime/test/specs/lstm_state.mod.py
@@ -0,0 +1,152 @@
+#
+# Copyright (C) 2017 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+# LSTM Test: No Cifg, No Peephole, No Projection, and No Clipping.
+
+model = Model()
+
+n_batch = 1
+n_input = 2
+# n_cell and n_output have the same size when there is no projection.
+n_cell = 4
+n_output = 4
+
+input = Input("input", "TENSOR_FLOAT32", "{%d, %d}" % (n_batch, n_input))
+
+input_to_input_weights = Input("input_to_input_weights", "TENSOR_FLOAT32", "{%d, %d}" % (n_cell, n_input))
+input_to_forget_weights = Input("input_to_forget_weights", "TENSOR_FLOAT32", "{%d, %d}" % (n_cell, n_input))
+input_to_cell_weights = Input("input_to_cell_weights", "TENSOR_FLOAT32", "{%d, %d}" % (n_cell, n_input))
+input_to_output_weights = Input("input_to_output_weights", "TENSOR_FLOAT32", "{%d, %d}" % (n_cell, n_input))
+
+recurrent_to_input_weights = Input("recurrent_to_intput_weights", "TENSOR_FLOAT32", "{%d, %d}" % (n_cell, n_output))
+recurrent_to_forget_weights = Input("recurrent_to_forget_weights", "TENSOR_FLOAT32", "{%d, %d}" % (n_cell, n_output))
+recurrent_to_cell_weights = Input("recurrent_to_cell_weights", "TENSOR_FLOAT32", "{%d, %d}" % (n_cell, n_output))
+recurrent_to_output_weights = Input("recurrent_to_output_weights", "TENSOR_FLOAT32", "{%d, %d}" % (n_cell, n_output))
+
+cell_to_input_weights = Input("cell_to_input_weights", "TENSOR_FLOAT32", "{0}")
+cell_to_forget_weights = Input("cell_to_forget_weights", "TENSOR_FLOAT32", "{0}")
+cell_to_output_weights = Input("cell_to_output_weights", "TENSOR_FLOAT32", "{0}")
+
+input_gate_bias = Input("input_gate_bias", "TENSOR_FLOAT32", "{%d}"%(n_cell))
+forget_gate_bias = Input("forget_gate_bias", "TENSOR_FLOAT32", "{%d}"%(n_cell))
+cell_gate_bias = Input("cell_gate_bias", "TENSOR_FLOAT32", "{%d}"%(n_cell))
+output_gate_bias = Input("output_gate_bias", "TENSOR_FLOAT32", "{%d}"%(n_cell))
+
+projection_weights = Input("projection_weights", "TENSOR_FLOAT32", "{0,0}")
+projection_bias = Input("projection_bias", "TENSOR_FLOAT32", "{0}")
+
+output_state_in = Input("output_state_in", "TENSOR_FLOAT32", "{%d, %d}" % (n_batch, n_output))
+cell_state_in = Input("cell_state_in", "TENSOR_FLOAT32", "{%d, %d}" % (n_batch, n_cell))
+
+activation_param = Input("activation_param", "TENSOR_INT32", "{1}")
+cell_clip_param = Input("cell_clip_param", "TENSOR_FLOAT32", "{1}")
+proj_clip_param = Input("proj_clip_param", "TENSOR_FLOAT32", "{1}")
+
+scratch_buffer = IgnoredOutput("scratch_buffer", "TENSOR_FLOAT32", "{%d, %d}" % (n_batch, (n_cell * 4)))
+output_state_out = Output("output_state_out", "TENSOR_FLOAT32", "{%d, %d}" % (n_batch, n_output))
+cell_state_out = Output("cell_state_out", "TENSOR_FLOAT32", "{%d, %d}" % (n_batch, n_cell))
+output = Output("output", "TENSOR_FLOAT32", "{%d, %d}" % (n_batch, n_output))
+
+model = model.Operation("LSTM",
+ input,
+
+ input_to_input_weights,
+ input_to_forget_weights,
+ input_to_cell_weights,
+ input_to_output_weights,
+
+ recurrent_to_input_weights,
+ recurrent_to_forget_weights,
+ recurrent_to_cell_weights,
+ recurrent_to_output_weights,
+
+ cell_to_input_weights,
+ cell_to_forget_weights,
+ cell_to_output_weights,
+
+ input_gate_bias,
+ forget_gate_bias,
+ cell_gate_bias,
+ output_gate_bias,
+
+ projection_weights,
+ projection_bias,
+
+ output_state_in,
+ cell_state_in,
+
+ activation_param,
+ cell_clip_param,
+ proj_clip_param
+).To([scratch_buffer, output_state_out, cell_state_out, output])
+
+# Example 1. Input in operand 0,
+input0 = {input_to_input_weights: [-0.45018822, -0.02338299, -0.0870589, -0.34550029, 0.04266912, -0.15680569, -0.34856534, 0.43890524],
+ input_to_forget_weights: [0.09701663, 0.20334584, -0.50592935, -0.31343272, -0.40032279, 0.44781327, 0.01387155, -0.35593212],
+ input_to_cell_weights: [-0.50013041, 0.1370284, 0.11810488, 0.2013163, -0.20583314, 0.44344562, 0.22077113, -0.29909778],
+ input_to_output_weights: [-0.25065863, -0.28290087, 0.04613829, 0.40525138, 0.44272184, 0.03897077, -0.1556896, 0.19487578],
+
+ input_gate_bias: [0.,0.,0.,0.],
+ forget_gate_bias: [1.,1.,1.,1.],
+ cell_gate_bias: [0.,0.,0.,0.],
+ output_gate_bias: [0.,0.,0.,0.],
+
+ recurrent_to_input_weights: [
+ -0.0063535, -0.2042388, 0.31454784, -0.35746509, 0.28902304, 0.08183324,
+ -0.16555229, 0.02286911, -0.13566875, 0.03034258, 0.48091322,
+ -0.12528998, 0.24077177, -0.51332325, -0.33502164, 0.10629296],
+
+ recurrent_to_cell_weights: [
+ -0.3407414, 0.24443203, -0.2078532, 0.26320225, 0.05695659, -0.00123841,
+ -0.4744786, -0.35869038, -0.06418842, -0.13502428, -0.501764, 0.22830659,
+ -0.46367589, 0.26016325, -0.03894562, -0.16368064],
+
+ recurrent_to_forget_weights: [
+ -0.48684245, -0.06655136, 0.42224967, 0.2112639, 0.27654213, 0.20864892,
+ -0.07646349, 0.45877004, 0.00141793, -0.14609534, 0.36447752, 0.09196436,
+ 0.28053468, 0.01560611, -0.20127171, -0.01140004],
+
+ recurrent_to_output_weights: [
+ 0.43385774, -0.17194885, 0.2718237, 0.09215671, 0.24107647, -0.39835793,
+ 0.18212086, 0.01301402, 0.48572797, -0.50656658, 0.20047462, -0.20607421,
+ -0.51818722, -0.15390486, 0.0468148, 0.39922136],
+
+ cell_to_input_weights: [],
+ cell_to_forget_weights: [],
+ cell_to_output_weights: [],
+
+ projection_weights: [],
+ projection_bias: [],
+
+ activation_param: [4], # Tanh
+ cell_clip_param: [0.],
+ proj_clip_param: [0.],
+}
+
+test_input = [3., 4.]
+output_state = [-0.0297319, 0.122947, 0.208851, -0.153588]
+cell_state = [-0.145439, 0.157475, 0.293663, -0.277353,]
+golden_output = [-0.03716109, 0.12507336, 0.41193449, -0.20860538]
+output0 = {
+ scratch_buffer: [ 0 for x in range(n_batch * n_cell * 4) ],
+ cell_state_out: [ -0.287121, 0.148115, 0.556837, -0.388276 ],
+ output_state_out: [ -0.0371611, 0.125073, 0.411934, -0.208605 ],
+ output: golden_output
+}
+input0[input] = test_input
+input0[output_state_in] = output_state
+input0[cell_state_in] = cell_state
+Example((input0, output0))
diff --git a/nn/runtime/test/specs/lstm_state2.mod.py b/nn/runtime/test/specs/lstm_state2.mod.py
new file mode 100644
index 000000000..945c631ef
--- /dev/null
+++ b/nn/runtime/test/specs/lstm_state2.mod.py
@@ -0,0 +1,152 @@
+#
+# Copyright (C) 2017 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+# LSTM Test: No Cifg, No Peephole, No Projection, and No Clipping.
+
+model = Model()
+
+n_batch = 1
+n_input = 2
+# n_cell and n_output have the same size when there is no projection.
+n_cell = 4
+n_output = 4
+
+input = Input("input", "TENSOR_FLOAT32", "{%d, %d}" % (n_batch, n_input))
+
+input_to_input_weights = Input("input_to_input_weights", "TENSOR_FLOAT32", "{%d, %d}" % (n_cell, n_input))
+input_to_forget_weights = Input("input_to_forget_weights", "TENSOR_FLOAT32", "{%d, %d}" % (n_cell, n_input))
+input_to_cell_weights = Input("input_to_cell_weights", "TENSOR_FLOAT32", "{%d, %d}" % (n_cell, n_input))
+input_to_output_weights = Input("input_to_output_weights", "TENSOR_FLOAT32", "{%d, %d}" % (n_cell, n_input))
+
+recurrent_to_input_weights = Input("recurrent_to_intput_weights", "TENSOR_FLOAT32", "{%d, %d}" % (n_cell, n_output))
+recurrent_to_forget_weights = Input("recurrent_to_forget_weights", "TENSOR_FLOAT32", "{%d, %d}" % (n_cell, n_output))
+recurrent_to_cell_weights = Input("recurrent_to_cell_weights", "TENSOR_FLOAT32", "{%d, %d}" % (n_cell, n_output))
+recurrent_to_output_weights = Input("recurrent_to_output_weights", "TENSOR_FLOAT32", "{%d, %d}" % (n_cell, n_output))
+
+cell_to_input_weights = Input("cell_to_input_weights", "TENSOR_FLOAT32", "{0}")
+cell_to_forget_weights = Input("cell_to_forget_weights", "TENSOR_FLOAT32", "{0}")
+cell_to_output_weights = Input("cell_to_output_weights", "TENSOR_FLOAT32", "{0}")
+
+input_gate_bias = Input("input_gate_bias", "TENSOR_FLOAT32", "{%d}"%(n_cell))
+forget_gate_bias = Input("forget_gate_bias", "TENSOR_FLOAT32", "{%d}"%(n_cell))
+cell_gate_bias = Input("cell_gate_bias", "TENSOR_FLOAT32", "{%d}"%(n_cell))
+output_gate_bias = Input("output_gate_bias", "TENSOR_FLOAT32", "{%d}"%(n_cell))
+
+projection_weights = Input("projection_weights", "TENSOR_FLOAT32", "{0,0}")
+projection_bias = Input("projection_bias", "TENSOR_FLOAT32", "{0}")
+
+output_state_in = Input("output_state_in", "TENSOR_FLOAT32", "{%d, %d}" % (n_batch, n_output))
+cell_state_in = Input("cell_state_in", "TENSOR_FLOAT32", "{%d, %d}" % (n_batch, n_cell))
+
+activation_param = Input("activation_param", "TENSOR_INT32", "{1}")
+cell_clip_param = Input("cell_clip_param", "TENSOR_FLOAT32", "{1}")
+proj_clip_param = Input("proj_clip_param", "TENSOR_FLOAT32", "{1}")
+
+scratch_buffer = IgnoredOutput("scratch_buffer", "TENSOR_FLOAT32", "{%d, %d}" % (n_batch, (n_cell * 4)))
+output_state_out = IgnoredOutput("output_state_out", "TENSOR_FLOAT32", "{%d, %d}" % (n_batch, n_output))
+cell_state_out = IgnoredOutput("cell_state_out", "TENSOR_FLOAT32", "{%d, %d}" % (n_batch, n_cell))
+output = Output("output", "TENSOR_FLOAT32", "{%d, %d}" % (n_batch, n_output))
+
+model = model.Operation("LSTM",
+ input,
+
+ input_to_input_weights,
+ input_to_forget_weights,
+ input_to_cell_weights,
+ input_to_output_weights,
+
+ recurrent_to_input_weights,
+ recurrent_to_forget_weights,
+ recurrent_to_cell_weights,
+ recurrent_to_output_weights,
+
+ cell_to_input_weights,
+ cell_to_forget_weights,
+ cell_to_output_weights,
+
+ input_gate_bias,
+ forget_gate_bias,
+ cell_gate_bias,
+ output_gate_bias,
+
+ projection_weights,
+ projection_bias,
+
+ output_state_in,
+ cell_state_in,
+
+ activation_param,
+ cell_clip_param,
+ proj_clip_param
+).To([scratch_buffer, output_state_out, cell_state_out, output])
+
+# Example 1. Input in operand 0,
+input0 = {input_to_input_weights: [-0.45018822, -0.02338299, -0.0870589, -0.34550029, 0.04266912, -0.15680569, -0.34856534, 0.43890524],
+ input_to_forget_weights: [0.09701663, 0.20334584, -0.50592935, -0.31343272, -0.40032279, 0.44781327, 0.01387155, -0.35593212],
+ input_to_cell_weights: [-0.50013041, 0.1370284, 0.11810488, 0.2013163, -0.20583314, 0.44344562, 0.22077113, -0.29909778],
+ input_to_output_weights: [-0.25065863, -0.28290087, 0.04613829, 0.40525138, 0.44272184, 0.03897077, -0.1556896, 0.19487578],
+
+ input_gate_bias: [0.,0.,0.,0.],
+ forget_gate_bias: [1.,1.,1.,1.],
+ cell_gate_bias: [0.,0.,0.,0.],
+ output_gate_bias: [0.,0.,0.,0.],
+
+ recurrent_to_input_weights: [
+ -0.0063535, -0.2042388, 0.31454784, -0.35746509, 0.28902304, 0.08183324,
+ -0.16555229, 0.02286911, -0.13566875, 0.03034258, 0.48091322,
+ -0.12528998, 0.24077177, -0.51332325, -0.33502164, 0.10629296],
+
+ recurrent_to_cell_weights: [
+ -0.3407414, 0.24443203, -0.2078532, 0.26320225, 0.05695659, -0.00123841,
+ -0.4744786, -0.35869038, -0.06418842, -0.13502428, -0.501764, 0.22830659,
+ -0.46367589, 0.26016325, -0.03894562, -0.16368064],
+
+ recurrent_to_forget_weights: [
+ -0.48684245, -0.06655136, 0.42224967, 0.2112639, 0.27654213, 0.20864892,
+ -0.07646349, 0.45877004, 0.00141793, -0.14609534, 0.36447752, 0.09196436,
+ 0.28053468, 0.01560611, -0.20127171, -0.01140004],
+
+ recurrent_to_output_weights: [
+ 0.43385774, -0.17194885, 0.2718237, 0.09215671, 0.24107647, -0.39835793,
+ 0.18212086, 0.01301402, 0.48572797, -0.50656658, 0.20047462, -0.20607421,
+ -0.51818722, -0.15390486, 0.0468148, 0.39922136],
+
+ cell_to_input_weights: [],
+ cell_to_forget_weights: [],
+ cell_to_output_weights: [],
+
+ projection_weights: [],
+ projection_bias: [],
+
+ activation_param: [4], # Tanh
+ cell_clip_param: [0.],
+ proj_clip_param: [0.],
+}
+
+test_input = [1., 1.]
+output_state = [-0.0371611, 0.125073, 0.411934, -0.208605]
+cell_state = [-0.287121, 0.148115, 0.556837, -0.388276]
+golden_output = [-0.15053082, 0.09120187, 0.24278517, -0.12222792]
+output0 = {
+ scratch_buffer: [ 0 for x in range(n_batch * n_cell * 4) ],
+ cell_state_out: [ 0 for x in range(n_batch * n_cell) ],
+ output_state_out: [ 0 for x in range(n_batch * n_output) ],
+ output: golden_output
+}
+input0[input] = test_input
+input0[output_state_in] = output_state
+input0[cell_state_in] = cell_state
+Example((input0, output0))
diff --git a/nn/runtime/test/specs/mobilenet_quantized.model.py b/nn/runtime/test/specs/mobilenet_quantized.mod.py
index 6612c8dba..6612c8dba 100644
--- a/nn/runtime/test/specs/mobilenet_quantized.model.py
+++ b/nn/runtime/test/specs/mobilenet_quantized.mod.py
diff --git a/nn/runtime/test/specs/rnn_state.mod.py b/nn/runtime/test/specs/rnn_state.mod.py
new file mode 100644
index 000000000..723a6e9e7
--- /dev/null
+++ b/nn/runtime/test/specs/rnn_state.mod.py
@@ -0,0 +1,127 @@
+#
+# Copyright (C) 2017 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+batches = 2
+units = 16
+input_size = 8
+
+model = Model()
+
+input = Input("input", "TENSOR_FLOAT32", "{%d, %d}" % (batches, input_size))
+weights = Input("weights", "TENSOR_FLOAT32", "{%d, %d}" % (units, input_size))
+recurrent_weights = Input("recurrent_weights", "TENSOR_FLOAT32", "{%d, %d}" % (units, units))
+bias = Input("bias", "TENSOR_FLOAT32", "{%d}" % (units))
+hidden_state_in = Input("hidden_state_in", "TENSOR_FLOAT32", "{%d, %d}" % (batches, units))
+
+activation_param = Input("activation_param", "TENSOR_INT32", "{1}")
+
+hidden_state_out = IgnoredOutput("hidden_state_out", "TENSOR_FLOAT32", "{%d, %d}" % (batches, units))
+output = Output("output", "TENSOR_FLOAT32", "{%d, %d}" % (batches, units))
+
+model = model.Operation("RNN", input, weights, recurrent_weights, bias, hidden_state_in,
+ activation_param).To([hidden_state_out, output])
+
+input0 = {
+ weights: [
+ 0.461459, 0.153381, 0.529743, -0.00371218, 0.676267, -0.211346,
+ 0.317493, 0.969689, -0.343251, 0.186423, 0.398151, 0.152399,
+ 0.448504, 0.317662, 0.523556, -0.323514, 0.480877, 0.333113,
+ -0.757714, -0.674487, -0.643585, 0.217766, -0.0251462, 0.79512,
+ -0.595574, -0.422444, 0.371572, -0.452178, -0.556069, -0.482188,
+ -0.685456, -0.727851, 0.841829, 0.551535, -0.232336, 0.729158,
+ -0.00294906, -0.69754, 0.766073, -0.178424, 0.369513, -0.423241,
+ 0.548547, -0.0152023, -0.757482, -0.85491, 0.251331, -0.989183,
+ 0.306261, -0.340716, 0.886103, -0.0726757, -0.723523, -0.784303,
+ 0.0354295, 0.566564, -0.485469, -0.620498, 0.832546, 0.697884,
+ -0.279115, 0.294415, -0.584313, 0.548772, 0.0648819, 0.968726,
+ 0.723834, -0.0080452, -0.350386, -0.272803, 0.115121, -0.412644,
+ -0.824713, -0.992843, -0.592904, -0.417893, 0.863791, -0.423461,
+ -0.147601, -0.770664, -0.479006, 0.654782, 0.587314, -0.639158,
+ 0.816969, -0.337228, 0.659878, 0.73107, 0.754768, -0.337042,
+ 0.0960841, 0.368357, 0.244191, -0.817703, -0.211223, 0.442012,
+ 0.37225, -0.623598, -0.405423, 0.455101, 0.673656, -0.145345,
+ -0.511346, -0.901675, -0.81252, -0.127006, 0.809865, -0.721884,
+ 0.636255, 0.868989, -0.347973, -0.10179, -0.777449, 0.917274,
+ 0.819286, 0.206218, -0.00785118, 0.167141, 0.45872, 0.972934,
+ -0.276798, 0.837861, 0.747958, -0.0151566, -0.330057, -0.469077,
+ 0.277308, 0.415818
+ ],
+ recurrent_weights: [
+ 0.1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0.1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0.1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0.1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0.1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0.1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0.1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0.1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0.1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0.1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0.1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0.1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0.1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0.1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0.1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0.1
+ ],
+ bias: [
+ 0.065691948, -0.69055247, 0.1107955, -0.97084129, -0.23957068,
+ -0.23566568, -0.389184, 0.47481549, -0.4791103, 0.29931796,
+ 0.10463274, 0.83918178, 0.37197268, 0.61957061, 0.3956964,
+ -0.37609905
+ ],
+ activation_param: [1], # Relu
+}
+
+input0[input] = [
+ -0.69424844, -0.93421471, -0.87287879, 0.37144363,
+ -0.62476718, 0.23791671, 0.40060222, 0.1356622,
+ -0.69424844, -0.93421471, -0.87287879, 0.37144363,
+ -0.62476718, 0.23791671, 0.40060222, 0.1356622,
+]
+input0[hidden_state_in] = [
+ 0.496726, 0, 0.965996, 0,
+ 0.0584256, 0, 0, 0.12315,
+ 0, 0, 0.612267, 0.456601,
+ 0, 0.52286, 1.16099, 0.0291233,
+ 0.496726, 0, 0.965996, 0,
+ 0.0584256, 0, 0, 0.12315,
+ 0, 0, 0.612267, 0.456601,
+ 0, 0.52286, 1.16099, 0.0291233,
+]
+output0 = {
+ hidden_state_out : [
+ 0, 0, 0.524902, 0,
+ 0, 0, 0, 1.02116,
+ 0, 1.35762, 0, 0.356909,
+ 0.436415, 0.0355731, 0, 0,
+ 0, 0, 0.524902, 0,
+ 0, 0, 0, 1.02116,
+ 0, 1.35762, 0, 0.356909,
+ 0.436415, 0.0355731, 0, 0,
+ ]
+}
+output0[output] = [
+ 0, 0, 0.524901, 0, 0, 0,
+ 0, 1.02116, 0, 1.35762, 0, 0.356909,
+ 0.436415, 0.0355727, 0, 0,
+
+ 0, 0, 0.524901, 0, 0, 0,
+ 0, 1.02116, 0, 1.35762, 0, 0.356909,
+ 0.436415, 0.0355727, 0, 0,
+]
+
+Example((input0, output0))
diff --git a/nn/runtime/test/specs/svdf_state.mod.py b/nn/runtime/test/specs/svdf_state.mod.py
new file mode 100644
index 000000000..aad2114e7
--- /dev/null
+++ b/nn/runtime/test/specs/svdf_state.mod.py
@@ -0,0 +1,116 @@
+#
+# Copyright (C) 2017 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+batches = 2
+units = 4
+input_size = 3
+memory_size = 10
+
+model = Model()
+
+input = Input("input", "TENSOR_FLOAT32", "{%d, %d}" % (batches, input_size))
+weights_feature = Input("weights_feature", "TENSOR_FLOAT32", "{%d, %d}" % (units, input_size))
+weights_time = Input("weights_time", "TENSOR_FLOAT32", "{%d, %d}" % (units, memory_size))
+bias = Input("bias", "TENSOR_FLOAT32", "{%d}" % (units))
+state_in = Input("state_in", "TENSOR_FLOAT32", "{%d, %d}" % (batches, memory_size*units))
+rank_param = Input("rank_param", "TENSOR_INT32", "{1}")
+activation_param = Input("activation_param", "TENSOR_INT32", "{1}")
+state_out = Output("state_out", "TENSOR_FLOAT32", "{%d, %d}" % (batches, memory_size*units))
+output = Output("output", "TENSOR_FLOAT32", "{%d, %d}" % (batches, units))
+
+model = model.Operation("SVDF", input, weights_feature, weights_time, bias, state_in,
+ rank_param, activation_param).To([state_out, output])
+
+input0 = {
+ weights_feature: [
+ -0.31930989, -0.36118156, 0.0079667, 0.37613347,
+ 0.22197971, 0.12416199, 0.27901134, 0.27557442,
+ 0.3905206, -0.36137494, -0.06634006, -0.10640851
+ ],
+ weights_time: [
+ -0.31930989, 0.37613347, 0.27901134, -0.36137494, -0.36118156,
+ 0.22197971, 0.27557442, -0.06634006, 0.0079667, 0.12416199,
+
+ 0.3905206, -0.10640851, -0.0976817, 0.15294972, 0.39635518,
+ -0.02702999, 0.39296314, 0.15785322, 0.21931258, 0.31053296,
+
+ -0.36916667, 0.38031587, -0.21580373, 0.27072677, 0.23622236,
+ 0.34936687, 0.18174365, 0.35907319, -0.17493086, 0.324846,
+
+ -0.10781813, 0.27201805, 0.14324132, -0.23681851, -0.27115166,
+ -0.01580888, -0.14943552, 0.15465137, 0.09784451, -0.0337657
+ ],
+ bias: [],
+ rank_param: [1],
+ activation_param: [0],
+}
+
+input0[input] = [
+ 0.14278367, -1.64410412, -0.75222826,
+ 0.14278367, -1.64410412, -0.75222826,
+]
+input0[state_in] = [
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0.119996, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, -0.166701, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, -0.44244, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0.0805206,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0.119996, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, -0.166701, 0, 0,
+ 0, 0, 0, 0,
+ 0, 0, -0.44244, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0.0805206,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+]
+output0 = {
+ state_out : [
+ 0, 0, 0, 0,
+ 0, 0, 0, 0.119996,
+ 0.542235, 0, 0, 0,
+ 0, 0, 0, 0,
+ -0.166701, -0.40465, 0, 0,
+ 0, 0, 0, 0,
+ 0, -0.44244, -0.706995, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0.0805206, 0.137515,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0.119996,
+ 0.542235, 0, 0, 0,
+ 0, 0, 0, 0,
+ -0.166701, -0.40465, 0, 0,
+ 0, 0, 0, 0,
+ 0, -0.44244, -0.706995, 0,
+ 0, 0, 0, 0,
+ 0, 0, 0.0805206, 0.137515,
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ ],
+ output : [
+ 0.068281, -0.162217, -0.152268, 0.00323521,
+ 0.068281, -0.162217, -0.152268, 0.00323521,
+ ]
+}
+
+Example((input0, output0))
diff --git a/nn/tools/test_generator/include/TestHarness.h b/nn/tools/test_generator/include/TestHarness.h
index 256a206e9..3e3abf0ff 100644
--- a/nn/tools/test_generator/include/TestHarness.h
+++ b/nn/tools/test_generator/include/TestHarness.h
@@ -175,7 +175,7 @@ inline void compare(const MixedTyped& golden, const MixedTyped& test) {
compare_<0>(golden, test,
[](float g, float t) { EXPECT_NEAR(g, t, 1.e-5f); });
compare_<1>(golden, test, [](int32_t g, int32_t t) { EXPECT_EQ(g, t); });
- compare_<2>(golden, test, [](uint8_t g, uint8_t t) { EXPECT_EQ(g, t); });
+ compare_<2>(golden, test, [](uint8_t g, uint8_t t) { EXPECT_NEAR(g, t, 1); });
}
}; // namespace generated_tests