From a9b1d24272770969c8de7d6676d8403d55302d9c Mon Sep 17 00:00:00 2001 From: =?utf8?q?=EB=B0=95=EC=84=B8=ED=9D=AC/On-Device=20Lab=28SR=29/Princip?= =?utf8?q?al=20Engineer/=EC=82=BC=EC=84=B1=EC=A0=84=EC=9E=90?= Date: Thu, 8 Aug 2019 15:55:34 +0900 Subject: [PATCH] [moco-tf] relocate Relu local class into anonymous (#6387) This will relocate local class of Relu import into anonymous namespace Signed-off-by: SaeHie Park --- compiler/moco-tf/src/Op/Relu.cpp | 53 +++++++++++++++++++++++----------------- 1 file changed, 30 insertions(+), 23 deletions(-) diff --git a/compiler/moco-tf/src/Op/Relu.cpp b/compiler/moco-tf/src/Op/Relu.cpp index c3a6a82..0c3ceee 100644 --- a/compiler/moco-tf/src/Op/Relu.cpp +++ b/compiler/moco-tf/src/Op/Relu.cpp @@ -31,19 +31,10 @@ #include #include -namespace moco -{ -namespace tf +namespace { -/** - * @brief GraphBuilder for Relu node - */ -class ReluGraphBuilder final : public ReluGraphBuilderBase -{ -public: - void build(const tensorflow::NodeDef &, GraphBuilderContext *) const override; -}; +using namespace moco::tf; class ReLUGraphUpdate final : public GraphUpdate { @@ -69,6 +60,34 @@ private: const TensorName _name; }; +void ReLUGraphUpdate::input(const SymbolTable *table) const +{ + loco::Node *target = table->node(_name); + _node->input(target); +} + +void TFReluGraphUpdate::input(const SymbolTable *table) const +{ + loco::Node *target = table->node(_name); + _node->features(target); +} + +} // namespace + +namespace moco +{ +namespace tf +{ + +/** + * @brief GraphBuilder for Relu node + */ +class ReluGraphBuilder final : public ReluGraphBuilderBase +{ +public: + void build(const tensorflow::NodeDef &, GraphBuilderContext *) const override; +}; + bool ReluGraphBuilderBase::validate(const tensorflow::NodeDef &node) const { // ReLU node SHOULD have only one input @@ -132,18 +151,6 @@ void ReluGraphBuilderImpl::build(const tensorflow::Nod updates->enroll(std::move(update)); } -void ReLUGraphUpdate::input(const SymbolTable *table) const -{ - loco::Node *target = table->node(_name); - _node->input(target); -} - -void TFReluGraphUpdate::input(const SymbolTable *table) const -{ - loco::Node *target = table->node(_name); - _node->features(target); -} - } // namespace tf } // namespace moco -- 2.7.4