diff options
author | 박종현/On-Device Lab(SR)/Staff Engineer/삼성전자 <jh1302.park@samsung.com> | 2019-09-17 13:55:27 +0900 |
---|---|---|
committer | GitHub Enterprise <noreply-CODE@samsung.com> | 2019-09-17 13:55:27 +0900 |
commit | a41629ffe046993e16fafbff37b11db73df74f47 (patch) | |
tree | c0e29ca8c7f8efd0122a7930ed921e56c44914c2 /compiler | |
parent | 7b5c9ffd644d7d033c82100bc3afc4245ca22443 (diff) | |
download | nnfw-a41629ffe046993e16fafbff37b11db73df74f47.tar.gz nnfw-a41629ffe046993e16fafbff37b11db73df74f47.tar.bz2 nnfw-a41629ffe046993e16fafbff37b11db73df74f47.zip |
[locomotiv] Simplify ReLU6 implementation (#7506)
Let's make ReLU6 similar to other element-wise unary operations.
Signed-off-by: Jonghyun Park <jh1302.park@samsung.com>
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/locomotiv/src/Node/ReLU6.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/compiler/locomotiv/src/Node/ReLU6.cpp b/compiler/locomotiv/src/Node/ReLU6.cpp index 7da892628..586c015fc 100644 --- a/compiler/locomotiv/src/Node/ReLU6.cpp +++ b/compiler/locomotiv/src/Node/ReLU6.cpp @@ -16,6 +16,8 @@ #include "NodeExecution.h" +// TODO Remove deprecated code +#if 0 #include "NodeDataImpl.h" #include "NodeDomain.h" #include "Validation.h" @@ -31,6 +33,7 @@ using nncc::core::ADT::tensor::make_buffer; #include <cassert> #include <stdexcept> +#endif namespace { @@ -44,6 +47,8 @@ namespace locomotiv void NodeExecution::execute(loco::ReLU6 *relu6) { +// TODO Remove deprecated code +#if 0 auto input_data = annot_data(relu6->input()); validate(input_data, "Input not ready"); @@ -76,6 +81,16 @@ void NodeExecution::execute(loco::ReLU6 *relu6) assert(relu6_data != nullptr); annot_data(relu6, std::move(relu6_data)); annot_domain(relu6, annot_domain(relu6->input())); +#endif + + struct Func final : public UnaryFunc + { + float apply(float v) const final { return relu6_ew(v); } + }; + + Func f; + + eltwise_unary(relu6, f); } } // namespace locomotiv |