From f175121228cf6b37c39860b90a5be51716d178c0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=EC=9C=A4=EC=A7=80=EC=98=81/=EB=8F=99=EC=9E=91=EC=A0=9C?= =?utf8?q?=EC=96=B4Lab=28SR=29/Engineer/=EC=82=BC=EC=84=B1=EC=A0=84?= =?utf8?q?=EC=9E=90?= Date: Thu, 9 Aug 2018 14:49:47 +0900 Subject: [PATCH] Support QASYMM8 in relu-related operators (#2237) * Support QASYMM8 in relu-related operators ReLU, ReLU1 and ReLU6 supports quantized operation It adds QuantizationInfo to TensorInfo in operations that supports QASYMM8_TENSOR Signed-off-by: Jiyoung Yun * Enable quant8 testcases of relu-related operator in GeneratedTests Enable below GeneratedTests: GeneratedTests.relu_quant8_1 GeneratedTests.relu_quant8_2 GeneratedTests.relu1_quant8_1 GeneratedTests.relu1_quant8_2 GeneratedTests.relu6_quant8_1 GeneratedTests.relu6_quant8_2 Signed-off-by: Jiyoung Yun --- runtimes/pure_arm_compute/src/compilation.cc | 18 ++++++++++++------ .../runtime_run_android_nn_test.skip.armv7l-linux | 6 ------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/runtimes/pure_arm_compute/src/compilation.cc b/runtimes/pure_arm_compute/src/compilation.cc index f894d59..b2e3645 100644 --- a/runtimes/pure_arm_compute/src/compilation.cc +++ b/runtimes/pure_arm_compute/src/compilation.cc @@ -2406,9 +2406,11 @@ void Planner::visit(const ::internal::tflite::op::ReLU::Node &node) // Set shape constraints _builder.addShapeConstr(ofm_index, - asTensorInfo(_ctx.at(ofm_index).shape(), _ctx.at(ofm_index).type())); + asTensorInfo(_ctx.at(ofm_index).shape(), _ctx.at(ofm_index).type(), + _ctx.at(ofm_index).scale(), _ctx.at(ofm_index).zeroPoint())); _builder.addShapeConstr(ifm_index, - asTensorInfo(_ctx.at(ifm_index).shape(), _ctx.at(ifm_index).type())); + asTensorInfo(_ctx.at(ifm_index).shape(), _ctx.at(ifm_index).type(), + _ctx.at(ifm_index).scale(), _ctx.at(ifm_index).zeroPoint())); struct Param { @@ -2447,9 +2449,11 @@ void Planner::visit(const ::internal::tflite::op::ReLU1::Node &node) // Set shape constraints _builder.addShapeConstr(ofm_index, - asTensorInfo(_ctx.at(ofm_index).shape(), _ctx.at(ofm_index).type())); + asTensorInfo(_ctx.at(ofm_index).shape(), _ctx.at(ofm_index).type(), + _ctx.at(ofm_index).scale(), _ctx.at(ofm_index).zeroPoint())); _builder.addShapeConstr(ifm_index, - asTensorInfo(_ctx.at(ifm_index).shape(), _ctx.at(ifm_index).type())); + asTensorInfo(_ctx.at(ifm_index).shape(), _ctx.at(ifm_index).type(), + _ctx.at(ifm_index).scale(), _ctx.at(ifm_index).zeroPoint())); struct Param { @@ -2488,9 +2492,11 @@ void Planner::visit(const ::internal::tflite::op::ReLU6::Node &node) // Set shape constraints _builder.addShapeConstr(ofm_index, - asTensorInfo(_ctx.at(ofm_index).shape(), _ctx.at(ofm_index).type())); + asTensorInfo(_ctx.at(ofm_index).shape(), _ctx.at(ofm_index).type(), + _ctx.at(ofm_index).scale(), _ctx.at(ofm_index).zeroPoint())); _builder.addShapeConstr(ifm_index, - asTensorInfo(_ctx.at(ifm_index).shape(), _ctx.at(ifm_index).type())); + asTensorInfo(_ctx.at(ifm_index).shape(), _ctx.at(ifm_index).type(), + _ctx.at(ifm_index).scale(), _ctx.at(ifm_index).zeroPoint())); struct Param { diff --git a/runtimes/tests/neural_networks_test/runtime_run_android_nn_test.skip.armv7l-linux b/runtimes/tests/neural_networks_test/runtime_run_android_nn_test.skip.armv7l-linux index 62009c8..b5a7714 100644 --- a/runtimes/tests/neural_networks_test/runtime_run_android_nn_test.skip.armv7l-linux +++ b/runtimes/tests/neural_networks_test/runtime_run_android_nn_test.skip.armv7l-linux @@ -34,8 +34,6 @@ GeneratedTests.lstm GeneratedTests.lstm_state2 GeneratedTests.lstm_state GeneratedTests.relu1_float_2 -GeneratedTests.relu1_quant8_1 -GeneratedTests.relu1_quant8_2 GeneratedTests.rnn GeneratedTests.rnn_state GeneratedTests.space_to_depth_float_1 @@ -114,11 +112,7 @@ GeneratedTests.mobilenet_quantized GeneratedTests.mul_broadcast_quant8 GeneratedTests.mul_quant8 GeneratedTests.relu6_float_2 -GeneratedTests.relu6_quant8_1 -GeneratedTests.relu6_quant8_2 GeneratedTests.relu_float_2 -GeneratedTests.relu_quant8_1 -GeneratedTests.relu_quant8_2 GeneratedTests.reshape_quant8_weights_as_inputs GeneratedTests.reshape_weights_as_inputs GeneratedTests.strided_slice_ex_float_1 -- 2.7.4