diff options
author | Viet Dang <vddang@google.com> | 2020-06-22 19:25:17 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2020-06-22 19:25:17 +0000 |
commit | 9ab6f52ad6070b9a1ddc41fdd0be5e4924cfbce6 (patch) | |
tree | e8a293aae6be267ad5001efd3fec7857d4ec819a | |
parent | cf86f80bac3447e2b30f24e56895cc4336eebbec (diff) | |
parent | 36c71e47e60a9dfd2bf50af7297258eafa31957c (diff) | |
download | ml-9ab6f52ad6070b9a1ddc41fdd0be5e4924cfbce6.tar.gz |
Merge "Sets bias quant scale in QLSTM test to 0 as it's unused." into rvc-dev am: 35a0a19e4f am: 36c71e47e6
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/ml/+/11914071
Change-Id: I7204967c27ee091aa022213e4fcdc4cd6ec43229
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) |