summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorViet Dang <vddang@google.com>2020-06-19 12:01:25 +0100
committerViet Dang <vddang@google.com>2020-06-22 15:52:28 +0100
commit3f162191a222e3cc7ec929225e5c3c22b5d7cc27 (patch)
tree8593cb3bec1d5c9aa4fda06658bd0eba0de5f24d
parentc7e4e604b2d4f1cf8f2bdbe11350a48c719148d3 (diff)
downloadml-3f162191a222e3cc7ec929225e5c3c22b5d7cc27.tar.gz
Sets bias quant scale in QLSTM test to 0 as it's unused.
Bug: 155421116 Test: NeuralNetworksTest_static Change-Id: I434d70e30b137a37febfab83127d79f9a6ecbae6
-rw-r--r--nn/runtime/test/generated/spec_V1_3/qlstm_noprojection.example.cpp16
-rw-r--r--nn/runtime/test/generated/spec_V1_3/qlstm_projection.example.cpp32
-rw-r--r--nn/runtime/test/specs/V1_3/qlstm_noprojection.mod.py3
-rw-r--r--nn/runtime/test/specs/V1_3/qlstm_projection.mod.py3
4 files changed, 28 insertions, 26 deletions
diff --git a/nn/runtime/test/generated/spec_V1_3/qlstm_noprojection.example.cpp b/nn/runtime/test/generated/spec_V1_3/qlstm_noprojection.example.cpp
index 0ce78ac30..3c9c4dd5f 100644
--- a/nn/runtime/test/generated/spec_V1_3/qlstm_noprojection.example.cpp
+++ b/nn/runtime/test/generated/spec_V1_3/qlstm_noprojection.example.cpp
@@ -140,7 +140,7 @@ const TestModel& get_test_model() {
.isIgnored = false,
.lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
.numberOfConsumers = 1,
- .scale = 4.65661e-08f,
+ .scale = 0.0f,
.type = TestOperandType::TENSOR_INT32,
.zeroPoint = 0
}, { // forget_gate_bias
@@ -150,7 +150,7 @@ const TestModel& get_test_model() {
.isIgnored = false,
.lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
.numberOfConsumers = 1,
- .scale = 4.65661e-08f,
+ .scale = 0.0f,
.type = TestOperandType::TENSOR_INT32,
.zeroPoint = 0
}, { // cell_gate_bias
@@ -160,7 +160,7 @@ const TestModel& get_test_model() {
.isIgnored = false,
.lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
.numberOfConsumers = 1,
- .scale = 4.65661e-08f,
+ .scale = 0.0f,
.type = TestOperandType::TENSOR_INT32,
.zeroPoint = 0
}, { // output_gate_bias
@@ -170,7 +170,7 @@ const TestModel& get_test_model() {
.isIgnored = false,
.lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
.numberOfConsumers = 1,
- .scale = 4.65661e-08f,
+ .scale = 0.0f,
.type = TestOperandType::TENSOR_INT32,
.zeroPoint = 0
}, { // projection_weights
@@ -517,7 +517,7 @@ const TestModel& get_test_model_all_inputs_as_internal() {
.isIgnored = false,
.lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
.numberOfConsumers = 1,
- .scale = 4.65661e-08f,
+ .scale = 0.0f,
.type = TestOperandType::TENSOR_INT32,
.zeroPoint = 0
}, { // forget_gate_bias
@@ -527,7 +527,7 @@ const TestModel& get_test_model_all_inputs_as_internal() {
.isIgnored = false,
.lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
.numberOfConsumers = 1,
- .scale = 4.65661e-08f,
+ .scale = 0.0f,
.type = TestOperandType::TENSOR_INT32,
.zeroPoint = 0
}, { // cell_gate_bias
@@ -537,7 +537,7 @@ const TestModel& get_test_model_all_inputs_as_internal() {
.isIgnored = false,
.lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
.numberOfConsumers = 1,
- .scale = 4.65661e-08f,
+ .scale = 0.0f,
.type = TestOperandType::TENSOR_INT32,
.zeroPoint = 0
}, { // output_gate_bias
@@ -547,7 +547,7 @@ const TestModel& get_test_model_all_inputs_as_internal() {
.isIgnored = false,
.lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
.numberOfConsumers = 1,
- .scale = 4.65661e-08f,
+ .scale = 0.0f,
.type = TestOperandType::TENSOR_INT32,
.zeroPoint = 0
}, { // projection_weights
diff --git a/nn/runtime/test/generated/spec_V1_3/qlstm_projection.example.cpp b/nn/runtime/test/generated/spec_V1_3/qlstm_projection.example.cpp
index 773141f92..47d462674 100644
--- a/nn/runtime/test/generated/spec_V1_3/qlstm_projection.example.cpp
+++ b/nn/runtime/test/generated/spec_V1_3/qlstm_projection.example.cpp
@@ -140,7 +140,7 @@ const TestModel& get_test_model() {
.isIgnored = false,
.lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
.numberOfConsumers = 1,
- .scale = 4.65661e-08f,
+ .scale = 0.0f,
.type = TestOperandType::TENSOR_INT32,
.zeroPoint = 0
}, { // forget_gate_bias
@@ -150,7 +150,7 @@ const TestModel& get_test_model() {
.isIgnored = false,
.lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
.numberOfConsumers = 1,
- .scale = 4.65661e-08f,
+ .scale = 0.0f,
.type = TestOperandType::TENSOR_INT32,
.zeroPoint = 0
}, { // cell_gate_bias
@@ -160,7 +160,7 @@ const TestModel& get_test_model() {
.isIgnored = false,
.lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
.numberOfConsumers = 1,
- .scale = 4.65661e-08f,
+ .scale = 0.0f,
.type = TestOperandType::TENSOR_INT32,
.zeroPoint = 0
}, { // output_gate_bias
@@ -170,7 +170,7 @@ const TestModel& get_test_model() {
.isIgnored = false,
.lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
.numberOfConsumers = 1,
- .scale = 4.65661e-08f,
+ .scale = 0.0f,
.type = TestOperandType::TENSOR_INT32,
.zeroPoint = 0
}, { // projection_weights
@@ -517,7 +517,7 @@ const TestModel& get_test_model_all_inputs_as_internal() {
.isIgnored = false,
.lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
.numberOfConsumers = 1,
- .scale = 4.65661e-08f,
+ .scale = 0.0f,
.type = TestOperandType::TENSOR_INT32,
.zeroPoint = 0
}, { // forget_gate_bias
@@ -527,7 +527,7 @@ const TestModel& get_test_model_all_inputs_as_internal() {
.isIgnored = false,
.lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
.numberOfConsumers = 1,
- .scale = 4.65661e-08f,
+ .scale = 0.0f,
.type = TestOperandType::TENSOR_INT32,
.zeroPoint = 0
}, { // cell_gate_bias
@@ -537,7 +537,7 @@ const TestModel& get_test_model_all_inputs_as_internal() {
.isIgnored = false,
.lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
.numberOfConsumers = 1,
- .scale = 4.65661e-08f,
+ .scale = 0.0f,
.type = TestOperandType::TENSOR_INT32,
.zeroPoint = 0
}, { // output_gate_bias
@@ -547,7 +547,7 @@ const TestModel& get_test_model_all_inputs_as_internal() {
.isIgnored = false,
.lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
.numberOfConsumers = 1,
- .scale = 4.65661e-08f,
+ .scale = 0.0f,
.type = TestOperandType::TENSOR_INT32,
.zeroPoint = 0
}, { // projection_weights
@@ -962,7 +962,7 @@ const TestModel& get_test_model_2() {
.isIgnored = false,
.lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
.numberOfConsumers = 1,
- .scale = 4.65661e-08f,
+ .scale = 0.0f,
.type = TestOperandType::TENSOR_INT32,
.zeroPoint = 0
}, { // forget_gate_bias
@@ -972,7 +972,7 @@ const TestModel& get_test_model_2() {
.isIgnored = false,
.lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
.numberOfConsumers = 1,
- .scale = 4.65661e-08f,
+ .scale = 0.0f,
.type = TestOperandType::TENSOR_INT32,
.zeroPoint = 0
}, { // cell_gate_bias
@@ -982,7 +982,7 @@ const TestModel& get_test_model_2() {
.isIgnored = false,
.lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
.numberOfConsumers = 1,
- .scale = 4.65661e-08f,
+ .scale = 0.0f,
.type = TestOperandType::TENSOR_INT32,
.zeroPoint = 0
}, { // output_gate_bias
@@ -992,7 +992,7 @@ const TestModel& get_test_model_2() {
.isIgnored = false,
.lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
.numberOfConsumers = 1,
- .scale = 4.65661e-08f,
+ .scale = 0.0f,
.type = TestOperandType::TENSOR_INT32,
.zeroPoint = 0
}, { // projection_weights
@@ -1339,7 +1339,7 @@ const TestModel& get_test_model_all_inputs_as_internal_2() {
.isIgnored = false,
.lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
.numberOfConsumers = 1,
- .scale = 4.65661e-08f,
+ .scale = 0.0f,
.type = TestOperandType::TENSOR_INT32,
.zeroPoint = 0
}, { // forget_gate_bias
@@ -1349,7 +1349,7 @@ const TestModel& get_test_model_all_inputs_as_internal_2() {
.isIgnored = false,
.lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
.numberOfConsumers = 1,
- .scale = 4.65661e-08f,
+ .scale = 0.0f,
.type = TestOperandType::TENSOR_INT32,
.zeroPoint = 0
}, { // cell_gate_bias
@@ -1359,7 +1359,7 @@ const TestModel& get_test_model_all_inputs_as_internal_2() {
.isIgnored = false,
.lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
.numberOfConsumers = 1,
- .scale = 4.65661e-08f,
+ .scale = 0.0f,
.type = TestOperandType::TENSOR_INT32,
.zeroPoint = 0
}, { // output_gate_bias
@@ -1369,7 +1369,7 @@ const TestModel& get_test_model_all_inputs_as_internal_2() {
.isIgnored = false,
.lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
.numberOfConsumers = 1,
- .scale = 4.65661e-08f,
+ .scale = 0.0f,
.type = TestOperandType::TENSOR_INT32,
.zeroPoint = 0
}, { // projection_weights
diff --git a/nn/runtime/test/specs/V1_3/qlstm_noprojection.mod.py b/nn/runtime/test/specs/V1_3/qlstm_noprojection.mod.py
index 18300a900..a592344c8 100644
--- a/nn/runtime/test/specs/V1_3/qlstm_noprojection.mod.py
+++ b/nn/runtime/test/specs/V1_3/qlstm_noprojection.mod.py
@@ -44,7 +44,8 @@ cell_to_input_weights = Input("cell_to_input_weights", CellWeightsType)
cell_to_forget_weights = Input("cell_to_forget_weights", CellWeightsType)
cell_to_output_weights = Input("cell_to_output_weights", CellWeightsType)
-BiasType = ("TENSOR_INT32", [num_units], 4.65661e-08, 0)
+# The bias scale value here is not used.
+BiasType = ("TENSOR_INT32", [num_units], 0.0, 0)
input_gate_bias = Input("input_gate_bias", BiasType)
forget_gate_bias = Input("forget_gate_bias", BiasType)
cell_gate_bias = Input("cell_gate_bias", BiasType)
diff --git a/nn/runtime/test/specs/V1_3/qlstm_projection.mod.py b/nn/runtime/test/specs/V1_3/qlstm_projection.mod.py
index 483602f21..187381e1e 100644
--- a/nn/runtime/test/specs/V1_3/qlstm_projection.mod.py
+++ b/nn/runtime/test/specs/V1_3/qlstm_projection.mod.py
@@ -44,7 +44,8 @@ cell_to_input_weights = Input("cell_to_input_weights", CellWeightsType)
cell_to_forget_weights = Input("cell_to_forget_weights", CellWeightsType)
cell_to_output_weights = Input("cell_to_output_weights", CellWeightsType)
-BiasType = ("TENSOR_INT32", [num_units], 4.65661e-08, 0)
+# The bias scale value here is not used.
+BiasType = ("TENSOR_INT32", [num_units], 0.0, 0)
input_gate_bias = Input("input_gate_bias", BiasType)
forget_gate_bias = Input("forget_gate_bias", BiasType)
cell_gate_bias = Input("cell_gate_bias", BiasType)