From: 박종현/동작제어Lab(SR)/Staff Engineer/삼성전자 Date: Thu, 11 Oct 2018 00:38:32 +0000 (+0900) Subject: [enco] Compile ReLU op in Eval instruction (#1813) X-Git-Tag: nncc_backup~1570 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=feaaa19c436833bb5e05585356e1958b4c57fb04;p=platform%2Fcore%2Fml%2Fnnfw.git [enco] Compile ReLU op in Eval instruction (#1813) With this commit, ANNOpBuild is now able to compile a simple ReLU op in Eval instruction. Signed-off-by: Jonghyun Park --- diff --git a/contrib/enco/core/src/Transforms/Split.cpp b/contrib/enco/core/src/Transforms/Split.cpp index f0cbfa7..9d7a366 100644 --- a/contrib/enco/core/src/Transforms/Split.cpp +++ b/contrib/enco/core/src/Transforms/Split.cpp @@ -403,6 +403,28 @@ public: } } } + else if (auto relu = eval->op()->asReLU()) + { + if (auto load = relu->arg()->asLoad()) + { + // Let's compile the following code fragment: + // + // %ofm = eval(ReLU(Load(%ifm)) + // + // TODO Support objects of other kinds, such as Tensor + auto ifm = load->object()->asFeature(); + auto ofm = eval->out()->asFeature(); + + assert(ifm != nullptr && ofm != nullptr); + + auto app = make_unique(); + + app->ifm(ifm); + app->ofm(ofm); + + return std::move(app); + } + } // Return nullptr if a given Eval instruction is incompatible return nullptr;