Change model IR for ResizeBilinear param (#8025)
author장지섭/On-Device Lab(SR)/Engineer/삼성전자 <jiseob.jang@samsung.com>
Thu, 10 Oct 2019 10:14:14 +0000 (19:14 +0900)
committer오형석/On-Device Lab(SR)/Staff Engineer/삼성전자 <hseok82.oh@samsung.com>
Thu, 10 Oct 2019 10:14:14 +0000 (19:14 +0900)
This commit changes model IR for ResizeBilinear param to scalar.

Signed-off-by: jiseob.jang <jiseob.jang@samsung.com>
runtimes/neurun/backend/acl_cl/KernelGenerator.cc
runtimes/neurun/backend/acl_neon/KernelGenerator.cc
runtimes/neurun/core/include/model/operation/ResizeBilinearNode.h
runtimes/neurun/frontend/nnapi/wrapper/OperationFactory.cc

index 2af0e7c..f42664d 100644 (file)
@@ -1241,10 +1241,6 @@ void KernelGenerator::visit(const model::operation::ResizeBilinearNode &node)
   const auto ofm_index{node.getOutputs().at(0)};
 
   const auto ifm_index{node.getInputs().at(model::operation::ResizeBilinearNode::Input::INPUT)};
-  const auto height_index{node.param().height_index};
-  const auto width_index{node.param().width_index};
-  (void)height_index;
-  (void)width_index;
 
   auto ofm_alloc = _tensor_builder->at(ofm_index).get();
   auto ifm_alloc = _tensor_builder->at(ifm_index).get();
index 78d0607..1543052 100644 (file)
@@ -1520,10 +1520,6 @@ void KernelGenerator::visit(const model::operation::ResizeBilinearNode &node)
   const auto ofm_index{node.getOutputs().at(0)};
 
   const auto ifm_index{node.getInputs().at(model::operation::ResizeBilinearNode::Input::INPUT)};
-  const auto height_index{node.param().height_index};
-  const auto width_index{node.param().width_index};
-  (void)height_index;
-  (void)width_index;
 
   auto ofm_alloc = _tensor_builder->at(ofm_index).get();
   auto ifm_alloc = _tensor_builder->at(ifm_index).get();
index 76f0341..0623b7c 100644 (file)
@@ -38,8 +38,8 @@ public:
 
   struct Param
   {
-    OperandIndex height_index;
-    OperandIndex width_index;
+    int32_t height_out;
+    int32_t width_out;
   };
 
 public:
index 0c1d19b..276e8ce 100644 (file)
@@ -866,7 +866,7 @@ OperationFactory::OperationFactory()
   };
 
   _map[ANEURALNETWORKS_RESIZE_BILINEAR] = [](const OperationFactory::Param &init_param,
-                                             neurun::model::Operands &) {
+                                             neurun::model::Operands &operands) {
     assert(init_param.input_count == 3 && init_param.output_count == 1);
 
     OperandIndexSequence outputs{init_param.outputs[0]};
@@ -879,8 +879,8 @@ OperationFactory::OperationFactory()
     OperandIndexSequence inputs{init_param.inputs[0]};
 
     operation::ResizeBilinearNode::Param param;
-    param.height_index = OperandIndex{init_param.inputs[1]};
-    param.width_index = OperandIndex{init_param.inputs[2]};
+    param.height_out = operands.at(OperandIndex{init_param.inputs[1]}).asScalar<int32_t>();
+    param.width_out = operands.at(OperandIndex{init_param.inputs[2]}).asScalar<int32_t>();
 
     return new operation::ResizeBilinearNode{inputs, outputs, param};
   };