[neurun] Make codegen impl less verbose (#3084)
authorPRAVEEN DORESWAMY NAIDU/System SW /SRI-Bangalore/Staff Engineer/삼성전자 <praveen.dn@samsung.com>
Thu, 11 Oct 2018 11:28:36 +0000 (16:58 +0530)
committer오형석/동작제어Lab(SR)/Staff Engineer/삼성전자 <hseok82.oh@samsung.com>
Thu, 11 Oct 2018 11:28:36 +0000 (20:28 +0900)
Since we have the inputs and outputs as operand::Index we do not need the full
scope resolution, hence changing those to auto for codegen.

Signed-off-by: Praveen D N <praveen.dn@samsung.com>
runtimes/neurun/src/codegen/Planner.cc

index fc54f39..54578a4 100644 (file)
@@ -66,8 +66,6 @@ void Planner::visit(const graph::operation::AvgPool2D::Implicit::Node &node)
 
 void Planner::visit(const graph::operation::Concat::Node &node)
 {
-  const ::neurun::graph::operand::Index ofm_index{node.getOutputs().at(0)};
-
   // NOTE This implementation assumes concat over feature depth
   // TODO Remove this assumption
   assert(_ctx.at(::neurun::graph::operand::Index{node.param().axis_index}).asScalar<int32_t>() ==
@@ -99,8 +97,8 @@ void Planner::visit(const graph::operation::FullyConnected::Node &node)
 
 void Planner::visit(const graph::operation::Reshape::Node &node)
 {
-  const ::neurun::graph::operand::Index output_index{node.getOutputs().at(0)};
-  const ::neurun::graph::operand::Index input_index{node.getInputs().at(0)};
+  const auto output_index{node.getOutputs().at(0)};
+  const auto input_index{node.getInputs().at(0)};
 
   // NOTE The content of a tensor specified by shape_index should be aligned with
   //      output tensor shape
@@ -130,8 +128,8 @@ void Planner::visit(const graph::operation::Softmax::Node &node)
 {
   VERBOSE(Softmax) << "Configure SOFTMAX operation" << std::endl;
 
-  const ::neurun::graph::operand::Index output_index{node.getOutputs().at(0)};
-  const ::neurun::graph::operand::Index input_index{node.getInputs().at(0)};
+  const auto output_index{node.getOutputs().at(0)};
+  const auto input_index{node.getInputs().at(0)};
 
   assert(_ctx.at(output_index).shape().rank() == _ctx.at(input_index).shape().rank());
 
@@ -159,8 +157,8 @@ void Planner::visit(const graph::operation::Permute::Node &node)
 {
   VERBOSE(Permute) << "Configure Permute operation" << std::endl;
 
-  const ::neurun::graph::operand::Index output_index{node.getOutputs().at(0)};
-  const ::neurun::graph::operand::Index input_index{node.getInputs().at(0)};
+  const auto output_index{node.getOutputs().at(0)};
+  const auto input_index{node.getInputs().at(0)};
 
   assert(_ctx.at(output_index).shape().rank() == _ctx.at(input_index).shape().rank());