summaryrefslogtreecommitdiff
path: root/nn/runtime/test/generated/spec_V1_1/lsh_projection_relaxed.example.cpp
diff options
context:
space:
mode:
authorXusong Wang <xusongw@google.com>2020-06-02 14:47:55 -0700
committerXusong Wang <xusongw@google.com>2020-06-02 14:47:55 -0700
commit54688b80e26325de12e1dd5112a31343f94d68ae (patch)
tree02341f58ada78cddcff535c7c609f78bc81d57b7 /nn/runtime/test/generated/spec_V1_1/lsh_projection_relaxed.example.cpp
parentc7e4e604b2d4f1cf8f2bdbe11350a48c719148d3 (diff)
downloadml-54688b80e26325de12e1dd5112a31343f94d68ae.tar.gz
Relaxed LSH_PROJECTION: do not convert the hash tensor as internal
LSH_PROJECTION is very sensitive to the value of the hash tensor. Prior to this CL, AllInputsAsInternalCoverter will convert the hash tensor to internal by introducing a dummy ADD operation. Under relaxed execution mode, the small precision loss in ADD will result in a significant difference in the final result. This CL prevents the hash tensor from being converted to internal in relaxed precision tests. Additionally, this CL removes a redundant variation in lsh_projection_float16. Fixes: 155962587 Test: NNT_static Change-Id: Id5522b4949a4e3ab4801537e8eb747a25f0cd0e8
Diffstat (limited to 'nn/runtime/test/generated/spec_V1_1/lsh_projection_relaxed.example.cpp')
-rw-r--r--nn/runtime/test/generated/spec_V1_1/lsh_projection_relaxed.example.cpp44
1 files changed, 5 insertions, 39 deletions
diff --git a/nn/runtime/test/generated/spec_V1_1/lsh_projection_relaxed.example.cpp b/nn/runtime/test/generated/spec_V1_1/lsh_projection_relaxed.example.cpp
index 68782659b..aa7ccfb24 100644
--- a/nn/runtime/test/generated/spec_V1_1/lsh_projection_relaxed.example.cpp
+++ b/nn/runtime/test/generated/spec_V1_1/lsh_projection_relaxed.example.cpp
@@ -277,13 +277,13 @@ const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() {
.expectedMultinomialDistributionTolerance = 0,
.isRelaxed = true,
.main = {
- .inputIndexes = {1, 5, 8},
+ .inputIndexes = {0, 1, 5},
.operands = {{ // hash
.channelQuant = {},
- .data = TestBuffer::createFromVector<float>({}),
+ .data = TestBuffer::createFromVector<float>({0.123f, 0.456f, -0.321f, -0.654f, 1.234f, 5.678f, -4.321f, -8.765f}),
.dimensions = {4, 2},
.isIgnored = false,
- .lifetime = TestOperandLifeTime::TEMPORARY_VARIABLE,
+ .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
.numberOfConsumers = 1,
.scale = 0.0f,
.type = TestOperandType::TENSOR_FLOAT32,
@@ -328,36 +328,6 @@ const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() {
.scale = 0.0f,
.type = TestOperandType::TENSOR_INT32,
.zeroPoint = 0
- }, { // hash_new
- .channelQuant = {},
- .data = TestBuffer::createFromVector<float>({0.123f, 0.456f, -0.321f, -0.654f, 1.234f, 5.678f, -4.321f, -8.765f}),
- .dimensions = {4, 2},
- .isIgnored = false,
- .lifetime = TestOperandLifeTime::SUBGRAPH_INPUT,
- .numberOfConsumers = 1,
- .scale = 0.0f,
- .type = TestOperandType::TENSOR_FLOAT32,
- .zeroPoint = 0
- }, { // dummy1
- .channelQuant = {},
- .data = TestBuffer::createFromVector<float>({0.0f}),
- .dimensions = {1},
- .isIgnored = false,
- .lifetime = TestOperandLifeTime::CONSTANT_COPY,
- .numberOfConsumers = 1,
- .scale = 0.0f,
- .type = TestOperandType::TENSOR_FLOAT32,
- .zeroPoint = 0
- }, { // param1
- .channelQuant = {},
- .data = TestBuffer::createFromVector<int32_t>({0}),
- .dimensions = {},
- .isIgnored = false,
- .lifetime = TestOperandLifeTime::CONSTANT_COPY,
- .numberOfConsumers = 1,
- .scale = 0.0f,
- .type = TestOperandType::INT32,
- .zeroPoint = 0
}, { // weight_new
.channelQuant = {},
.data = TestBuffer::createFromVector<float>({0.12f, 0.34f, 0.56f}),
@@ -368,7 +338,7 @@ const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() {
.scale = 0.0f,
.type = TestOperandType::TENSOR_FLOAT32,
.zeroPoint = 0
- }, { // dummy2
+ }, { // dummy1
.channelQuant = {},
.data = TestBuffer::createFromVector<float>({0.0f}),
.dimensions = {1},
@@ -378,7 +348,7 @@ const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() {
.scale = 0.0f,
.type = TestOperandType::TENSOR_FLOAT32,
.zeroPoint = 0
- }, { // param2
+ }, { // param1
.channelQuant = {},
.data = TestBuffer::createFromVector<int32_t>({0}),
.dimensions = {},
@@ -391,10 +361,6 @@ const TestModel& get_test_model_all_tensors_as_inputs_all_inputs_as_internal() {
}},
.operations = {{
.inputs = {5, 6, 7},
- .outputs = {0},
- .type = TestOperationType::ADD
- }, {
- .inputs = {8, 9, 10},
.outputs = {2},
.type = TestOperationType::ADD
}, {