From 279305b06c1a1abaf555cd2c78878f645de36110 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 10:45:50 +0900 Subject: [PATCH] [moco-tf] relocate Add local class into anonymous (#6365) This will relocate local class of Add import into anonymous namespace Signed-off-by: SaeHie Park --- compiler/moco-tf/src/Op/Add.cpp | 49 +++++++++++++++++++++++------------------ 1 file changed, 28 insertions(+), 21 deletions(-) diff --git a/compiler/moco-tf/src/Op/Add.cpp b/compiler/moco-tf/src/Op/Add.cpp index f5a1a79..b957cf4 100644 --- a/compiler/moco-tf/src/Op/Add.cpp +++ b/compiler/moco-tf/src/Op/Add.cpp @@ -24,20 +24,10 @@ #include -namespace moco -{ -namespace tf +namespace { -/** - * @brief GraphBuilder for Add node - */ -class AddGraphBuilder final : public GraphBuilder -{ -public: - bool validate(const tensorflow::NodeDef &) const override; - void build(const tensorflow::NodeDef &, GraphBuilderContext *) const override; -}; +using namespace moco::tf; /** * @brief GraphUpdate for TF Add node @@ -54,6 +44,32 @@ private: std::vector _names; }; +void TFAddGraphUpdate::input(const SymbolTable *tensor_names) const +{ + int num_inputs = _names.size(); + assert(num_inputs == 2); + + _node->x(tensor_names->node(_names[0])); + _node->y(tensor_names->node(_names[1])); +} + +} // namespace + +namespace moco +{ +namespace tf +{ + +/** + * @brief GraphBuilder for Add node + */ +class AddGraphBuilder final : public GraphBuilder +{ +public: + bool validate(const tensorflow::NodeDef &) const override; + void build(const tensorflow::NodeDef &, GraphBuilderContext *) const override; +}; + bool AddGraphBuilder::validate(const tensorflow::NodeDef &node) const { assert(node.input_size() == 2); @@ -83,15 +99,6 @@ void AddGraphBuilder::build(const tensorflow::NodeDef &node, GraphBuilderContext updates->enroll(std::move(tf_add_update)); } -void TFAddGraphUpdate::input(const SymbolTable *tensor_names) const -{ - int num_inputs = _names.size(); - assert(num_inputs == 2); - - _node->x(tensor_names->node(_names[0])); - _node->y(tensor_names->node(_names[1])); -} - } // namespace tf } // namespace moco -- 2.7.4