From 5d076cd1f946594d39e7f805bb58a5337e3c0307 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=EC=98=A4=ED=98=95=EC=84=9D/On-Device=20Lab=28SR=29/Staff?= =?utf8?q?=20Engineer/=EC=82=BC=EC=84=B1=EC=A0=84=EC=9E=90?= Date: Fri, 17 May 2019 12:49:01 +0900 Subject: [PATCH] Rename padding type enum class (#5209) Rename padding type enum class: Padding -> PaddingType Prepare introduce padding struct including padding type and value Signed-off-by: Hyeongseok Oh --- runtimes/neurun/backend/acl_cl/StageGenerator.cc | 39 ++++++++++++---------- runtimes/neurun/backend/acl_neon/StageGenerator.cc | 28 +++++++++------- runtimes/neurun/backend/cpu/StageGenerator.cc | 28 +++++++++------- runtimes/neurun/core/include/model/InternalType.h | 2 +- .../core/include/model/operation/AvgPool2DNode.h | 2 +- .../core/include/model/operation/Conv2DNode.h | 2 +- .../include/model/operation/DepthwiseConv2DNode.h | 2 +- .../core/include/model/operation/L2Pool2DNode.h | 2 +- .../core/include/model/operation/MaxPool2DNode.h | 2 +- .../include/model/operation/TransposeConvNode.h | 2 +- runtimes/neurun/core/include/util/Utils.h | 2 +- .../neurun/core/src/compiler/OperationValidator.cc | 4 +-- runtimes/neurun/core/src/graph/dumper/Dumper.cc | 8 ++--- runtimes/neurun/core/src/util/Utils.cc | 12 +++---- .../neurun/frontend/nnapi/wrapper/NNAPIConvert.cc | 6 ++-- .../neurun/frontend/nnapi/wrapper/NNAPIConvert.h | 2 +- .../frontend/nnapi/wrapper/OperationFactory.cc | 10 +++--- runtimes/neurun/test/graph/operation/SetIO.cc | 2 +- 18 files changed, 84 insertions(+), 71 deletions(-) diff --git a/runtimes/neurun/backend/acl_cl/StageGenerator.cc b/runtimes/neurun/backend/acl_cl/StageGenerator.cc index 5b37af4..439ec7a 100644 --- a/runtimes/neurun/backend/acl_cl/StageGenerator.cc +++ b/runtimes/neurun/backend/acl_cl/StageGenerator.cc @@ -256,11 +256,12 @@ void StageGenerator::visit(const model::operation::Conv2DNode &node) // TODO : Extract this to a function const auto padding_type = node.param().padding; param.padding = [&]() { - if (padding_type != model::Padding::EXPLICIT) // implicit padding + if (padding_type != model::PaddingType::EXPLICIT) // implicit padding { - assert((padding_type == model::Padding::SAME) || (padding_type == model::Padding::VALID)); + assert((padding_type == model::PaddingType::SAME) || + (padding_type == model::PaddingType::VALID)); - return (padding_type == model::Padding::SAME) + return (padding_type == model::PaddingType::SAME) ? neurun::util::same_padding(ifm_shape, ofm_shape, stride, ker_shape.W, ker_shape.H) : neurun::util::valid_padding(); @@ -352,11 +353,12 @@ void StageGenerator::visit(const model::operation::DepthwiseConv2DNode &node) // TODO : Extract this to a function const auto padding_type = node.param().padding; param.padding = [&]() { - if (padding_type != model::Padding::EXPLICIT) // implicit padding + if (padding_type != model::PaddingType::EXPLICIT) // implicit padding { - assert((padding_type == model::Padding::SAME) || (padding_type == model::Padding::VALID)); + assert((padding_type == model::PaddingType::SAME) || + (padding_type == model::PaddingType::VALID)); - return (padding_type == model::Padding::SAME) + return (padding_type == model::PaddingType::SAME) ? neurun::util::same_padding(_ctx.at(ifm_index).shape().asFeature(), _ctx.at(ofm_index).shape().asFeature(), param.stride, ker_shape.W, ker_shape.H) @@ -449,11 +451,12 @@ void StageGenerator::visit(const model::operation::MaxPool2DNode &node) // TODO : Extract this to a function const auto padding_type = node.param().padding; param.padding = [&]() { - if (padding_type != model::Padding::EXPLICIT) // implicit padding + if (padding_type != model::PaddingType::EXPLICIT) // implicit padding { - assert((padding_type == model::Padding::SAME) || (padding_type == model::Padding::VALID)); + assert((padding_type == model::PaddingType::SAME) || + (padding_type == model::PaddingType::VALID)); - return (padding_type == model::Padding::SAME) + return (padding_type == model::PaddingType::SAME) ? neurun::util::same_padding(ifm_shape, ofm_shape, param.stride, kw, kh) : neurun::util::valid_padding(); } @@ -555,11 +558,12 @@ void StageGenerator::visit(const model::operation::AvgPool2DNode &node) // TODO : Extract this to a function const auto padding_type = node.param().padding; param.padding = [&]() { - if (padding_type != model::Padding::EXPLICIT) // implicit padding + if (padding_type != model::PaddingType::EXPLICIT) // implicit padding { - assert((padding_type == model::Padding::SAME) || (padding_type == model::Padding::VALID)); + assert((padding_type == model::PaddingType::SAME) || + (padding_type == model::PaddingType::VALID)); - return (padding_type == model::Padding::SAME) + return (padding_type == model::PaddingType::SAME) ? neurun::util::same_padding(ifm_shape, ofm_shape, param.stride, kw, kh) : neurun::util::valid_padding(); } @@ -2016,11 +2020,12 @@ void StageGenerator::visit(const model::operation::L2Pool2DNode &node) // TODO : Extract this to a function const auto padding_type = node.param().padding; param.padding = [&]() { - if (padding_type != model::Padding::EXPLICIT) // implicit padding + if (padding_type != model::PaddingType::EXPLICIT) // implicit padding { - assert((padding_type == model::Padding::SAME) || (padding_type == model::Padding::VALID)); + assert((padding_type == model::PaddingType::SAME) || + (padding_type == model::PaddingType::VALID)); - return (padding_type == model::Padding::SAME) + return (padding_type == model::PaddingType::SAME) ? neurun::util::same_padding(ifm_shape, ofm_shape, stride, kw, kh) : neurun::util::valid_padding(); } @@ -2310,9 +2315,9 @@ void StageGenerator::visit(const model::operation::TransposeConvNode &node) param.stride.vertical = vstride; const auto padding_type = node.param().padding; - assert((padding_type == model::Padding::SAME) || (padding_type == model::Padding::VALID)); + assert((padding_type == model::PaddingType::SAME) || (padding_type == model::PaddingType::VALID)); param.padding = - (padding_type == model::Padding::SAME) + (padding_type == model::PaddingType::SAME) ? neurun::util::same_padding(ifm_shape, ofm_shape, param.stride, ker_shape.W, ker_shape.H) : neurun::util::valid_padding(); diff --git a/runtimes/neurun/backend/acl_neon/StageGenerator.cc b/runtimes/neurun/backend/acl_neon/StageGenerator.cc index 12ef5b4..72615ca 100644 --- a/runtimes/neurun/backend/acl_neon/StageGenerator.cc +++ b/runtimes/neurun/backend/acl_neon/StageGenerator.cc @@ -223,11 +223,12 @@ void StageGenerator::visit(const model::operation::Conv2DNode &node) // TODO : Extract this to a function const auto padding_type = node.param().padding; param.padding = [&]() { - if (padding_type != model::Padding::EXPLICIT) // implicit padding + if (padding_type != model::PaddingType::EXPLICIT) // implicit padding { - assert((padding_type == model::Padding::SAME) || (padding_type == model::Padding::VALID)); + assert((padding_type == model::PaddingType::SAME) || + (padding_type == model::PaddingType::VALID)); - return (padding_type == model::Padding::SAME) + return (padding_type == model::PaddingType::SAME) ? neurun::util::same_padding(ifm_shape, ofm_shape, stride, ker_shape.W, ker_shape.H) : neurun::util::valid_padding(); @@ -319,11 +320,12 @@ void StageGenerator::visit(const model::operation::DepthwiseConv2DNode &node) // TODO : Extract this to a function const auto padding_type = node.param().padding; param.padding = [&]() { - if (padding_type != model::Padding::EXPLICIT) // implicit padding + if (padding_type != model::PaddingType::EXPLICIT) // implicit padding { - assert((padding_type == model::Padding::SAME) || (padding_type == model::Padding::VALID)); + assert((padding_type == model::PaddingType::SAME) || + (padding_type == model::PaddingType::VALID)); - return (padding_type == model::Padding::SAME) + return (padding_type == model::PaddingType::SAME) ? neurun::util::same_padding(_ctx.at(ifm_index).shape().asFeature(), _ctx.at(ofm_index).shape().asFeature(), param.stride, ker_shape.W, ker_shape.H) @@ -416,11 +418,12 @@ void StageGenerator::visit(const model::operation::MaxPool2DNode &node) // TODO : Extract this to a function const auto padding_type = node.param().padding; param.padding = [&]() { - if (padding_type != model::Padding::EXPLICIT) // implicit padding + if (padding_type != model::PaddingType::EXPLICIT) // implicit padding { - assert((padding_type == model::Padding::SAME) || (padding_type == model::Padding::VALID)); + assert((padding_type == model::PaddingType::SAME) || + (padding_type == model::PaddingType::VALID)); - return (padding_type == model::Padding::SAME) + return (padding_type == model::PaddingType::SAME) ? neurun::util::same_padding(ifm_shape, ofm_shape, param.stride, kw, kh) : neurun::util::valid_padding(); } @@ -522,11 +525,12 @@ void StageGenerator::visit(const model::operation::AvgPool2DNode &node) // TODO : Extract this to a function const auto padding_type = node.param().padding; param.padding = [&]() { - if (padding_type != model::Padding::EXPLICIT) // implicit padding + if (padding_type != model::PaddingType::EXPLICIT) // implicit padding { - assert((padding_type == model::Padding::SAME) || (padding_type == model::Padding::VALID)); + assert((padding_type == model::PaddingType::SAME) || + (padding_type == model::PaddingType::VALID)); - return (padding_type == model::Padding::SAME) + return (padding_type == model::PaddingType::SAME) ? neurun::util::same_padding(ifm_shape, ofm_shape, param.stride, kw, kh) : neurun::util::valid_padding(); } diff --git a/runtimes/neurun/backend/cpu/StageGenerator.cc b/runtimes/neurun/backend/cpu/StageGenerator.cc index 1cc1c8e..3fb6bf0 100644 --- a/runtimes/neurun/backend/cpu/StageGenerator.cc +++ b/runtimes/neurun/backend/cpu/StageGenerator.cc @@ -106,11 +106,12 @@ void StageGenerator::visit(const model::operation::Conv2DNode &node) // TODO : Extract this to a function const auto padding_type = node.param().padding; param.padding = [&]() { - if (padding_type != model::Padding::EXPLICIT) // implicit padding + if (padding_type != model::PaddingType::EXPLICIT) // implicit padding { - assert((padding_type == model::Padding::SAME) || (padding_type == model::Padding::VALID)); + assert((padding_type == model::PaddingType::SAME) || + (padding_type == model::PaddingType::VALID)); - return (padding_type == model::Padding::SAME) + return (padding_type == model::PaddingType::SAME) ? neurun::util::same_padding(_ctx.at(ifm_index).shape().asFeature(), _ctx.at(ofm_index).shape().asFeature(), stride, _ctx.at(ker_index).shape().asKernel().W, @@ -210,11 +211,12 @@ void StageGenerator::visit(const model::operation::DepthwiseConv2DNode &node) // TODO : Extract this to a function const auto padding_type = node.param().padding; param.padding = [&]() { - if (padding_type != model::Padding::EXPLICIT) // implicit padding + if (padding_type != model::PaddingType::EXPLICIT) // implicit padding { - assert((padding_type == model::Padding::SAME) || (padding_type == model::Padding::VALID)); + assert((padding_type == model::PaddingType::SAME) || + (padding_type == model::PaddingType::VALID)); - return (padding_type == model::Padding::SAME) + return (padding_type == model::PaddingType::SAME) ? neurun::util::same_padding(_ctx.at(ifm_index).shape().asFeature(), _ctx.at(ofm_index).shape().asFeature(), param.stride, _ctx.at(ker_index).shape().asKernel().W, @@ -309,11 +311,12 @@ void StageGenerator::visit(const model::operation::MaxPool2DNode &node) // TODO : Extract this to a function const auto padding_type = node.param().padding; param.padding = [&]() { - if (padding_type != model::Padding::EXPLICIT) // implicit padding + if (padding_type != model::PaddingType::EXPLICIT) // implicit padding { - assert((padding_type == model::Padding::SAME) || (padding_type == model::Padding::VALID)); + assert((padding_type == model::PaddingType::SAME) || + (padding_type == model::PaddingType::VALID)); - return (padding_type == model::Padding::SAME) + return (padding_type == model::PaddingType::SAME) ? neurun::util::same_padding(_ctx.at(ifm_index).shape().asFeature(), _ctx.at(ofm_index).shape().asFeature(), param.stride, kw, kh) @@ -403,11 +406,12 @@ void StageGenerator::visit(const model::operation::AvgPool2DNode &node) // TODO : Extract this to a function const auto padding_type = node.param().padding; param.padding = [&]() { - if (padding_type != model::Padding::EXPLICIT) // implicit padding + if (padding_type != model::PaddingType::EXPLICIT) // implicit padding { - assert((padding_type == model::Padding::SAME) || (padding_type == model::Padding::VALID)); + assert((padding_type == model::PaddingType::SAME) || + (padding_type == model::PaddingType::VALID)); - return (padding_type == model::Padding::SAME) + return (padding_type == model::PaddingType::SAME) ? neurun::util::same_padding(_ctx.at(ifm_index).shape().asFeature(), _ctx.at(ofm_index).shape().asFeature(), param.stride, kw, kh) diff --git a/runtimes/neurun/core/include/model/InternalType.h b/runtimes/neurun/core/include/model/InternalType.h index 4043158..54ba6bd 100644 --- a/runtimes/neurun/core/include/model/InternalType.h +++ b/runtimes/neurun/core/include/model/InternalType.h @@ -32,7 +32,7 @@ enum class Activation SIGMOID = 5 }; -enum class Padding +enum class PaddingType { EXPLICIT = 0, SAME = 1, diff --git a/runtimes/neurun/core/include/model/operation/AvgPool2DNode.h b/runtimes/neurun/core/include/model/operation/AvgPool2DNode.h index cf0e54e..dd62f55 100644 --- a/runtimes/neurun/core/include/model/operation/AvgPool2DNode.h +++ b/runtimes/neurun/core/include/model/operation/AvgPool2DNode.h @@ -45,7 +45,7 @@ public: OperandIndex hstride_index; OperandIndex vstride_index; - Padding padding; + PaddingType padding; OperandIndex padding_left_index; OperandIndex padding_right_index; diff --git a/runtimes/neurun/core/include/model/operation/Conv2DNode.h b/runtimes/neurun/core/include/model/operation/Conv2DNode.h index b5e314f..be3f019 100644 --- a/runtimes/neurun/core/include/model/operation/Conv2DNode.h +++ b/runtimes/neurun/core/include/model/operation/Conv2DNode.h @@ -44,7 +44,7 @@ public: OperandIndex hstride_index; OperandIndex vstride_index; - Padding padding; + PaddingType padding; OperandIndex padding_left_index; OperandIndex padding_right_index; diff --git a/runtimes/neurun/core/include/model/operation/DepthwiseConv2DNode.h b/runtimes/neurun/core/include/model/operation/DepthwiseConv2DNode.h index 5d27eb5..ddd0d07 100644 --- a/runtimes/neurun/core/include/model/operation/DepthwiseConv2DNode.h +++ b/runtimes/neurun/core/include/model/operation/DepthwiseConv2DNode.h @@ -44,7 +44,7 @@ public: OperandIndex hstride_index; OperandIndex vstride_index; - Padding padding; + PaddingType padding; OperandIndex padding_left_index; OperandIndex padding_right_index; diff --git a/runtimes/neurun/core/include/model/operation/L2Pool2DNode.h b/runtimes/neurun/core/include/model/operation/L2Pool2DNode.h index 5fbddfb..eedfbda 100644 --- a/runtimes/neurun/core/include/model/operation/L2Pool2DNode.h +++ b/runtimes/neurun/core/include/model/operation/L2Pool2DNode.h @@ -39,7 +39,7 @@ public: struct Param { - Padding padding; + PaddingType padding; OperandIndex padding_left_index; OperandIndex padding_right_index; diff --git a/runtimes/neurun/core/include/model/operation/MaxPool2DNode.h b/runtimes/neurun/core/include/model/operation/MaxPool2DNode.h index 8217e70..23626cf 100644 --- a/runtimes/neurun/core/include/model/operation/MaxPool2DNode.h +++ b/runtimes/neurun/core/include/model/operation/MaxPool2DNode.h @@ -45,7 +45,7 @@ public: OperandIndex hstride_index; OperandIndex vstride_index; - Padding padding; + PaddingType padding; OperandIndex padding_left_index; OperandIndex padding_right_index; diff --git a/runtimes/neurun/core/include/model/operation/TransposeConvNode.h b/runtimes/neurun/core/include/model/operation/TransposeConvNode.h index 38ba3f5..3247501 100644 --- a/runtimes/neurun/core/include/model/operation/TransposeConvNode.h +++ b/runtimes/neurun/core/include/model/operation/TransposeConvNode.h @@ -41,7 +41,7 @@ public: struct Param { - Padding padding; + PaddingType padding; OperandIndex hstride_index; OperandIndex vstride_index; }; diff --git a/runtimes/neurun/core/include/util/Utils.h b/runtimes/neurun/core/include/util/Utils.h index 4520528..29a8201 100644 --- a/runtimes/neurun/core/include/util/Utils.h +++ b/runtimes/neurun/core/include/util/Utils.h @@ -37,7 +37,7 @@ namespace util * @param[in] code Padding type to be converted * @return A string holding the converted value */ -const char *to_string(const model::Padding &type); +const char *to_string(const model::PaddingType &type); } // namespace util } // namespace neurun diff --git a/runtimes/neurun/core/src/compiler/OperationValidator.cc b/runtimes/neurun/core/src/compiler/OperationValidator.cc index e567f00..9204c9d 100644 --- a/runtimes/neurun/core/src/compiler/OperationValidator.cc +++ b/runtimes/neurun/core/src/compiler/OperationValidator.cc @@ -356,8 +356,8 @@ void OperationValidator::visit(const model::operation::TransposeConvNode &node) assert(vstride > 0); assert(hstride > 0); - assert((node.param().padding == model::Padding::SAME) || - (node.param().padding == model::Padding::VALID)); + assert((node.param().padding == model::PaddingType::SAME) || + (node.param().padding == model::PaddingType::VALID)); assert(ifm_shape.N == ofm_shape.N); assert(ifm_shape.C == ker_shape.C); assert(ker_shape.N == ofm_shape.C); diff --git a/runtimes/neurun/core/src/graph/dumper/Dumper.cc b/runtimes/neurun/core/src/graph/dumper/Dumper.cc index 8d548ab..771a685 100644 --- a/runtimes/neurun/core/src/graph/dumper/Dumper.cc +++ b/runtimes/neurun/core/src/graph/dumper/Dumper.cc @@ -93,7 +93,7 @@ void Dumper::visit(const ConcatNode &node) void Dumper::visit(const Conv2DNode &node) { std::string padding_type = - node.param().padding == model::Padding::EXPLICIT ? "Explicit" : "Implicit"; + node.param().padding == model::PaddingType::EXPLICIT ? "Explicit" : "Implicit"; VERBOSE(LIR) << "* Conv2D(" << padding_type << ")" << std::endl; VERBOSE(LIR) << " - Inputs : IFM(" << node.getInputs().at(Conv2DNode::Input::INPUT).value() << ") Kernel(" << node.getInputs().at(Conv2DNode::Input::KERNEL).value() << ") Bias(" @@ -112,7 +112,7 @@ void Dumper::visit(const DepthToSpaceNode &node) void Dumper::visit(const DepthwiseConv2DNode &node) { std::string padding_type = - node.param().padding == model::Padding::EXPLICIT ? "Explicit" : "Implicit"; + node.param().padding == model::PaddingType::EXPLICIT ? "Explicit" : "Implicit"; VERBOSE(LIR) << "* DepthwiseConv2D(" << padding_type << ")" << std::endl; VERBOSE(LIR) << " - Inputs : IFM(" << node.getInputs().at(DepthwiseConv2DNode::Input::INPUT).value() << ") Kernel(" @@ -259,7 +259,7 @@ void Dumper::visit(const LogisticNode &node) void Dumper::visit(const MaxPool2DNode &node) { std::string padding_type = - node.param().padding == model::Padding::EXPLICIT ? "Explicit" : "Implicit"; + node.param().padding == model::PaddingType::EXPLICIT ? "Explicit" : "Implicit"; VERBOSE(LIR) << "* MaxPool2D(" << padding_type << ")" << std::endl; VERBOSE(LIR) << " - Inputs : IFM(" << node.getInputs().at(MaxPool2DNode::Input::INPUT).value() << ")" << std::endl; @@ -469,7 +469,7 @@ void Dumper::visit(const TopKV2Node &node) void Dumper::visit(const TransposeConvNode &node) { std::string padding_type = - node.param().padding == model::Padding::EXPLICIT ? "Explicit" : "Implicit"; + node.param().padding == model::PaddingType::EXPLICIT ? "Explicit" : "Implicit"; VERBOSE(LIR) << "* TransposeConv(" << padding_type << ")" << std::endl; VERBOSE(LIR) << " - Inputs : Output Shape(" << node.getInputs().at(TransposeConvNode::Input::OUTPUT_SHAPE).value() << ") KERNEL(" diff --git a/runtimes/neurun/core/src/util/Utils.cc b/runtimes/neurun/core/src/util/Utils.cc index 3149a7d..36c5807 100644 --- a/runtimes/neurun/core/src/util/Utils.cc +++ b/runtimes/neurun/core/src/util/Utils.cc @@ -23,18 +23,18 @@ namespace neurun namespace util { -const char *to_string(const model::Padding &type) +const char *to_string(const model::PaddingType &type) { - assert((type == model::Padding::EXPLICIT) || (type == model::Padding::SAME) || - (type == model::Padding::VALID)); + assert((type == model::PaddingType::EXPLICIT) || (type == model::PaddingType::SAME) || + (type == model::PaddingType::VALID)); switch (type) { - case model::Padding::EXPLICIT: + case model::PaddingType::EXPLICIT: return "Padding::EXPLICIT"; - case model::Padding::SAME: + case model::PaddingType::SAME: return "Padding::SAME"; - case model::Padding::VALID: + case model::PaddingType::VALID: return "Padding::VALID"; } diff --git a/runtimes/neurun/frontend/nnapi/wrapper/NNAPIConvert.cc b/runtimes/neurun/frontend/nnapi/wrapper/NNAPIConvert.cc index ae032e1..7347553 100644 --- a/runtimes/neurun/frontend/nnapi/wrapper/NNAPIConvert.cc +++ b/runtimes/neurun/frontend/nnapi/wrapper/NNAPIConvert.cc @@ -83,14 +83,14 @@ Activation NNAPIConvert::getFusedActivation(FuseCode act) } } -Padding NNAPIConvert::getPaddingType(PaddingCode type) +PaddingType NNAPIConvert::getPaddingType(PaddingCode type) { switch (type) { case ANEURALNETWORKS_PADDING_SAME: - return Padding::SAME; + return PaddingType::SAME; case ANEURALNETWORKS_PADDING_VALID: - return Padding::VALID; + return PaddingType::VALID; default: throw std::runtime_error("Unsupported type"); } diff --git a/runtimes/neurun/frontend/nnapi/wrapper/NNAPIConvert.h b/runtimes/neurun/frontend/nnapi/wrapper/NNAPIConvert.h index 62a016c..bd7fc6c 100644 --- a/runtimes/neurun/frontend/nnapi/wrapper/NNAPIConvert.h +++ b/runtimes/neurun/frontend/nnapi/wrapper/NNAPIConvert.h @@ -75,7 +75,7 @@ public: * @param[in] act NNAPI's PaddingCode type * @return neurun's internal padding type */ - static ::neurun::model::Padding getPaddingType(PaddingCode type); + static ::neurun::model::PaddingType getPaddingType(PaddingCode type); }; #endif // __NEURUN_NNAPI_CONVERT_H__ diff --git a/runtimes/neurun/frontend/nnapi/wrapper/OperationFactory.cc b/runtimes/neurun/frontend/nnapi/wrapper/OperationFactory.cc index 5ac71ea..d30dc3d 100644 --- a/runtimes/neurun/frontend/nnapi/wrapper/OperationFactory.cc +++ b/runtimes/neurun/frontend/nnapi/wrapper/OperationFactory.cc @@ -92,7 +92,7 @@ OperationFactory::OperationFactory() const auto activation_index = OperandIndex{init_param.inputs[10]}; - param.padding = Padding::EXPLICIT; + param.padding = PaddingType::EXPLICIT; param.padding_left_index = OperandIndex{init_param.inputs[3]}; param.padding_right_index = OperandIndex{init_param.inputs[4]}; param.padding_top_index = OperandIndex{init_param.inputs[5]}; @@ -159,7 +159,7 @@ OperationFactory::OperationFactory() const auto activation_index = OperandIndex{init_param.inputs[9]}; - param.padding = Padding::EXPLICIT; + param.padding = PaddingType::EXPLICIT; param.padding_left_index = OperandIndex{init_param.inputs[1]}; param.padding_right_index = OperandIndex{init_param.inputs[2]}; @@ -228,7 +228,7 @@ OperationFactory::OperationFactory() auto activation_index = OperandIndex{init_param.inputs[9]}; - param.padding = Padding::EXPLICIT; + param.padding = PaddingType::EXPLICIT; param.padding_left_index = OperandIndex{init_param.inputs[1]}; param.padding_right_index = OperandIndex{init_param.inputs[2]}; @@ -393,7 +393,7 @@ OperationFactory::OperationFactory() const auto activation_index = OperandIndex{init_param.inputs[6]}; - param.padding = Padding::EXPLICIT; + param.padding = PaddingType::EXPLICIT; param.padding_left_index = OperandIndex{init_param.inputs[3]}; param.padding_right_index = OperandIndex{init_param.inputs[4]}; param.padding_top_index = OperandIndex{init_param.inputs[5]}; @@ -904,7 +904,7 @@ OperationFactory::OperationFactory() // 9 -> FuseCode (activation) Index const auto activation_index = OperandIndex{init_param.inputs[9]}; - param.padding = Padding::EXPLICIT; + param.padding = PaddingType::EXPLICIT; param.padding_left_index = OperandIndex{init_param.inputs[1]}; param.padding_right_index = OperandIndex{init_param.inputs[2]}; param.padding_top_index = OperandIndex{init_param.inputs[3]}; diff --git a/runtimes/neurun/test/graph/operation/SetIO.cc b/runtimes/neurun/test/graph/operation/SetIO.cc index 3bcd7af..b41065f 100644 --- a/runtimes/neurun/test/graph/operation/SetIO.cc +++ b/runtimes/neurun/test/graph/operation/SetIO.cc @@ -46,7 +46,7 @@ TEST(graph_operation_setIO, operation_setIO_conv) IndexSet inputs{input_operand, kernel_operand, bias_operand}; GraphNode::Param conv_params; - conv_params.padding = neurun::model::Padding::SAME; + conv_params.padding = neurun::model::PaddingType::SAME; conv_params.hstride_index = model.operands.append(shape, type); conv_params.vstride_index = model.operands.append(shape, type); conv_params.activation = neurun::model::Activation::NONE; -- 2.7.4