From 3f162191a222e3cc7ec929225e5c3c22b5d7cc27 Mon Sep 17 00:00:00 2001 From: Viet Dang Date: Fri, 19 Jun 2020 12:01:25 +0100 Subject: Sets bias quant scale in QLSTM test to 0 as it's unused. Bug: 155421116 Test: NeuralNetworksTest_static Change-Id: I434d70e30b137a37febfab83127d79f9a6ecbae6 --- .../spec_V1_3/qlstm_noprojection.example.cpp | 16 +++++------ .../spec_V1_3/qlstm_projection.example.cpp | 32 +++++++++++----------- .../test/specs/V1_3/qlstm_noprojection.mod.py | 3 +- nn/runtime/test/specs/V1_3/qlstm_projection.mod.py | 3 +- 4 files changed, 28 insertions(+), 26 deletions(-) (limited to 'nn') 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) -- cgit v1.2.3