From b1b9671be797563c3f19e874e8c9f0e6c022636b Mon Sep 17 00:00:00 2001 From: =?utf8?q?=EC=9E=A5=EC=A7=80=EC=84=AD/On-Device=20Lab=28SR=29/Enginee?= =?utf8?q?r/=EC=82=BC=EC=84=B1=EC=A0=84=EC=9E=90?= Date: Thu, 10 Oct 2019 19:14:14 +0900 Subject: [PATCH] Change model IR for ResizeBilinear param (#8025) This commit changes model IR for ResizeBilinear param to scalar. Signed-off-by: jiseob.jang --- runtimes/neurun/backend/acl_cl/KernelGenerator.cc | 4 ---- runtimes/neurun/backend/acl_neon/KernelGenerator.cc | 4 ---- runtimes/neurun/core/include/model/operation/ResizeBilinearNode.h | 4 ++-- runtimes/neurun/frontend/nnapi/wrapper/OperationFactory.cc | 6 +++--- 4 files changed, 5 insertions(+), 13 deletions(-) diff --git a/runtimes/neurun/backend/acl_cl/KernelGenerator.cc b/runtimes/neurun/backend/acl_cl/KernelGenerator.cc index 2af0e7c..f42664d 100644 --- a/runtimes/neurun/backend/acl_cl/KernelGenerator.cc +++ b/runtimes/neurun/backend/acl_cl/KernelGenerator.cc @@ -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(); diff --git a/runtimes/neurun/backend/acl_neon/KernelGenerator.cc b/runtimes/neurun/backend/acl_neon/KernelGenerator.cc index 78d0607..1543052 100644 --- a/runtimes/neurun/backend/acl_neon/KernelGenerator.cc +++ b/runtimes/neurun/backend/acl_neon/KernelGenerator.cc @@ -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(); diff --git a/runtimes/neurun/core/include/model/operation/ResizeBilinearNode.h b/runtimes/neurun/core/include/model/operation/ResizeBilinearNode.h index 76f0341..0623b7c 100644 --- a/runtimes/neurun/core/include/model/operation/ResizeBilinearNode.h +++ b/runtimes/neurun/core/include/model/operation/ResizeBilinearNode.h @@ -38,8 +38,8 @@ public: struct Param { - OperandIndex height_index; - OperandIndex width_index; + int32_t height_out; + int32_t width_out; }; public: diff --git a/runtimes/neurun/frontend/nnapi/wrapper/OperationFactory.cc b/runtimes/neurun/frontend/nnapi/wrapper/OperationFactory.cc index 0c1d19b..276e8ce 100644 --- a/runtimes/neurun/frontend/nnapi/wrapper/OperationFactory.cc +++ b/runtimes/neurun/frontend/nnapi/wrapper/OperationFactory.cc @@ -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(); + param.width_out = operands.at(OperandIndex{init_param.inputs[2]}).asScalar(); return new operation::ResizeBilinearNode{inputs, outputs, param}; }; -- 2.7.4