Remove unused shape variables from visit func (#3221)
authorShubham Gupta/System SW /SRI-Bangalore/Engineer/삼성전자 <shub98.gupta@samsung.com>
Thu, 18 Oct 2018 22:28:36 +0000 (03:58 +0530)
committer박세희/동작제어Lab(SR)/Principal Engineer/삼성전자 <saehie.park@samsung.com>
Thu, 18 Oct 2018 22:28:36 +0000 (07:28 +0900)
This patch removes the unused shape variables.

Signed-off-by: shubham <shub98.gupta@samsung.com>
runtimes/pure_arm_compute/src/compilation.cc

index 01f66e6..229683f 100644 (file)
@@ -3585,10 +3585,6 @@ void Planner::visit(const ::internal::tflite::op::Pad::Node &node)
   const ::internal::tflite::operand::Index ifm_index{node.param().ifm_index};
   const ::internal::tflite::operand::Index paddings_index{node.param().paddings_index};
 
-  const auto ofm_shape = _ctx.at(ofm_index).shape().asFeature();
-  const auto ifm_shape = _ctx.at(ifm_index).shape().asFeature();
-  const auto paddings_shape = _ctx.at(paddings_index).shape().asTensor();
-
   // Set Shape Constraints and TensorInfo
   _builder.addShapeConstr(
       ifm_index, asTensorInfo(asTensorShape(_ctx.at(ifm_index).shape()), _ctx.at(ifm_index).type(),
@@ -3838,9 +3834,6 @@ void Planner::visit(const ::internal::tflite::op::L2Normalization::Node &node)
   const ::internal::tflite::operand::Index ofm_index{node.param().ofm_index};
   const ::internal::tflite::operand::Index ifm_index{node.param().ifm_index};
 
-  const auto ofm_shape = _ctx.at(ofm_index).shape();
-  const auto ifm_shape = _ctx.at(ifm_index).shape();
-
   // Set Shape Constraints and TensorInfo
   _builder.addShapeConstr(
       ifm_index, asTensorInfo(asTensorShape(_ctx.at(ifm_index).shape()), _ctx.at(ifm_index).type(),
@@ -3871,10 +3864,10 @@ void Planner::visit(const ::internal::tflite::op::L2Normalization::Node &node)
   param.ofm_index = ofm_index.asInt();
   param.ifm_index = ifm_index.asInt();
 
-  param.radius = 2 * ifm_shape.dim(3) + 1; // normSize = depth * 2 + 1
-  param.alpha = 1.0f;                      // In the implementation to make alpha_ become 1
-  param.beta = 0.5f;                       // pow(reduction, -0.5) = 1 / sqrt(reduction)
-  param.bias = 0.0f;                       // Don't offset the reduction.
+  param.radius = 2 * _ctx.at(ifm_index).shape().dim(3) + 1; // normSize = depth * 2 + 1
+  param.alpha = 1.0f; // In the implementation to make alpha_ become 1
+  param.beta = 0.5f;  // pow(reduction, -0.5) = 1 / sqrt(reduction)
+  param.bias = 0.0f;  // Don't offset the reduction.
 
   auto stage = [param](const IAllocationContext &ctx, IExecutionBuilder &builder) {
     auto ofm_alloc = ctx.at(::internal::tflite::operand::Index{param.ofm_index});