summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorViet Dang <vddang@google.com>2020-06-22 18:55:22 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2020-06-22 18:55:22 +0000
commit35a0a19e4f10194b6a989fb2ab49ad91d87e700b (patch)
treee8a293aae6be267ad5001efd3fec7857d4ec819a
parente941d7c787df84718e89ee57e6f71850d539cf6a (diff)
parent3f162191a222e3cc7ec929225e5c3c22b5d7cc27 (diff)
downloadml-35a0a19e4f10194b6a989fb2ab49ad91d87e700b.tar.gz
Merge "Sets bias quant scale in QLSTM test to 0 as it's unused." into rvc-dev
-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)