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

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

index 72c6f5c..8f697cc 100644 (file)
 
 #include <stdex/Memory.h>
 
-namespace moco
-{
-namespace tf
+namespace
 {
-/**
- * @brief GraphBuilder for Relu6 node
- */
-class Relu6GraphBuilder final : public Relu6GraphBuilderBase
-{
-public:
-  void build(const tensorflow::NodeDef &, GraphBuilderContext *) const override;
-};
+
+using namespace moco::tf;
 
 class ReLU6GraphUpdate final : public GraphUpdate
 {
@@ -60,6 +52,33 @@ private:
   const TensorName _name;
 };
 
+void ReLU6GraphUpdate::input(const SymbolTable *table) const
+{
+  loco::Node *target = table->node(_name);
+  _node->input(target);
+}
+
+void TFRelu6GraphUpdate::input(const SymbolTable *table) const
+{
+  loco::Node *target = table->node(_name);
+  _node->features(target);
+}
+
+} // namespace
+
+namespace moco
+{
+namespace tf
+{
+/**
+ * @brief GraphBuilder for Relu6 node
+ */
+class Relu6GraphBuilder final : public Relu6GraphBuilderBase
+{
+public:
+  void build(const tensorflow::NodeDef &, GraphBuilderContext *) const override;
+};
+
 bool Relu6GraphBuilderBase::validate(const tensorflow::NodeDef &node) const
 {
   // ReLU6 node SHOULD have only one input
@@ -122,18 +141,6 @@ void Relu6GraphBuilderImpl<ImportTarget::TensorFlow>::build(const tensorflow::No
   updates->enroll(std::move(update));
 }
 
-void ReLU6GraphUpdate::input(const SymbolTable *table) const
-{
-  loco::Node *target = table->node(_name);
-  _node->input(target);
-}
-
-void TFRelu6GraphUpdate::input(const SymbolTable *table) const
-{
-  loco::Node *target = table->node(_name);
-  _node->features(target);
-}
-
 } // namespace tf
 } // namespace moco