Support quantization for Logistic activate function (#2344)
author윤지영/동작제어Lab(SR)/Engineer/삼성전자 <jy910.yun@samsung.com>
Mon, 20 Aug 2018 02:08:17 +0000 (11:08 +0900)
committer오형석/동작제어Lab(SR)/Staff Engineer/삼성전자 <hseok82.oh@samsung.com>
Mon, 20 Aug 2018 02:08:17 +0000 (11:08 +0900)
This patch allows to pass the scale and zeroPoint to backend

Signed-off-by: Jiyoung Yun <jy910.yun@samsung.com>
runtimes/pure_arm_compute/src/compilation.cc

index 0588af8..d519614 100644 (file)
@@ -2639,9 +2639,11 @@ void Planner::visit(const ::internal::tflite::op::Logistic::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
   {