[moco-tf] relocate Relu local class into anonymous (#6387)
author박세희/On-Device Lab(SR)/Principal Engineer/삼성전자 <saehie.park@samsung.com>
Thu, 8 Aug 2019 06:55:34 +0000 (15:55 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Thu, 8 Aug 2019 06:55:34 +0000 (15:55 +0900)
This will relocate local class of Relu import into anonymous namespace

Signed-off-by: SaeHie Park <saehie.park@samsung.com>
compiler/moco-tf/src/Op/Relu.cpp

index c3a6a82..0c3ceee 100644 (file)
 #include <cassert>
 #include <stdexcept>
 
-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<ImportTarget::TensorFlow>::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