From ef5dbc9dbce7ab58c01f5c117e5db0c7afffcb95 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Shubham=20Gupta/System=20SW=20/SRI-Bangalore/Engineer/?= =?utf8?q?=EC=82=BC=EC=84=B1=EC=A0=84=EC=9E=90?= Date: Thu, 11 Oct 2018 17:00:36 +0530 Subject: [PATCH] Fix max_pool op to support quant type (#3016) This patch will fix the max_pool_quant8_3 Gtest And adds support for Quantization. Signed-off-by: shubham --- runtimes/pure_arm_compute/src/compilation.cc | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/runtimes/pure_arm_compute/src/compilation.cc b/runtimes/pure_arm_compute/src/compilation.cc index a531da2..827f697 100644 --- a/runtimes/pure_arm_compute/src/compilation.cc +++ b/runtimes/pure_arm_compute/src/compilation.cc @@ -1552,10 +1552,12 @@ void Planner::visit(const ::internal::tflite::op::MaxPool2D::Implicit::Node &nod // TODO Should move to the place where the operand is handled, if it is possible. // Set Shape Constraints and TensorInfo - _builder.addShapeConstr(ofm_index, asTensorInfo(asTensorShape(_ctx.at(ofm_index).shape()), - _ctx.at(ofm_index).type())); - _builder.addShapeConstr(ifm_index, asTensorInfo(asTensorShape(_ctx.at(ifm_index).shape()), - _ctx.at(ifm_index).type())); + _builder.addShapeConstr( + ofm_index, asTensorInfo(asTensorShape(_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(asTensorShape(_ctx.at(ifm_index).shape()), _ctx.at(ifm_index).type(), + _ctx.at(ifm_index).scale(), _ctx.at(ifm_index).zeroPoint())); // Construct operation parameters struct Param @@ -1667,10 +1669,12 @@ void Planner::visit(const ::internal::tflite::op::MaxPool2D::Explicit::Node &nod // TODO Should move to the place where the operand is handled, if it is possible. // Set Shape Constraints and TensorInfo - _builder.addShapeConstr(ofm_index, asTensorInfo(asTensorShape(_ctx.at(ofm_index).shape()), - _ctx.at(ofm_index).type())); - _builder.addShapeConstr(ifm_index, asTensorInfo(asTensorShape(_ctx.at(ifm_index).shape()), - _ctx.at(ifm_index).type())); + _builder.addShapeConstr( + ofm_index, asTensorInfo(asTensorShape(_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(asTensorShape(_ctx.at(ifm_index).shape()), _ctx.at(ifm_index).type(), + _ctx.at(ifm_index).scale(), _ctx.at(ifm_index).zeroPoint())); // Construct operation parameters struct Param -- 2.7.4