From: Shubham Gupta/System SW /SRI-Bangalore/Engineer/삼성전자 Date: Thu, 11 Oct 2018 11:30:36 +0000 (+0530) Subject: Fix max_pool op to support quant type (#3016) X-Git-Tag: 0.3~665 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ef5dbc9dbce7ab58c01f5c117e5db0c7afffcb95;p=platform%2Fcore%2Fml%2Fnnfw.git 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 --- 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