[moco] Add UpdateQueue member (#3537)
author박세희/On-Device Lab(SR)/Principal Engineer/삼성전자 <saehie.park@samsung.com>
Mon, 20 May 2019 09:29:12 +0000 (18:29 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Mon, 20 May 2019 09:29:12 +0000 (18:29 +0900)
This will add UpdateQueue attribute in GraphBuilderContext

Signed-off-by: SaeHie Park <saehie.park@samsung.com>
contrib/moco/lib/frontend/tf/src/Frontend.cpp
contrib/moco/lib/frontend/tf/src/GraphBuilderContext.h
contrib/moco/lib/frontend/tf/src/GraphBuilderContext.test.cpp

index 700ad4a..2863303 100644 (file)
@@ -103,8 +103,9 @@ void convert_graph(const moco::tf::ModelSignature &signature, tensorflow::GraphD
 {
   auto nodes = stdex::make_unique<moco::tf::SymbolTable>();
   auto input_names = stdex::make_unique<moco::tf::SymbolTable>();
+  auto updates = stdex::make_unique<moco::tf::UpdateQueue>();
 
-  moco::tf::GraphBuilderContext gb_context(graph, nodes.get(), input_names.get());
+  moco::tf::GraphBuilderContext gb_context(graph, nodes.get(), input_names.get(), updates.get());
 
   // Building a loco graph
   // 1. Convert all the nodes to loco::Node
index b49c578..64aee5b 100644 (file)
@@ -67,6 +67,7 @@ private:
 
   MapNameNode_t _namenode;
   MapNodeNames_t _nodenames;
+  MapNameNode_t _table;
 };
 
 /**
@@ -110,8 +111,9 @@ private:
 class GraphBuilderContext
 {
 public:
-  GraphBuilderContext(loco::Graph *g, SymbolTable *nodes, SymbolTable *input_names)
-      : _g(g), _nodes(nodes), _input_names(input_names)
+  GraphBuilderContext(loco::Graph *g, SymbolTable *nodes, SymbolTable *input_names,
+                      UpdateQueue *updates)
+      : _g(g), _nodes(nodes), _input_names(input_names), _updates(updates)
   {
     // DO NOTHING
   }
@@ -123,11 +125,13 @@ public:
   loco::Graph *graph() { return _g; }
   SymbolTable *nodes() { return _nodes; }
   SymbolTable *input_names() { return _input_names; }
+  UpdateQueue *updates() { return _updates; }
 
 private:
   loco::Graph *_g;
   SymbolTable *_nodes;
   SymbolTable *_input_names;
+  UpdateQueue *_updates;
 };
 
 } // namespace tf
index 51a5ebe..d5c502d 100644 (file)
@@ -25,12 +25,14 @@ TEST(GraphBuilderContext, ctor)
   auto graph = loco::make_graph();
   moco::tf::SymbolTable nodes;
   moco::tf::SymbolTable input_names;
+  moco::tf::UpdateQueue updates;
 
-  moco::tf::GraphBuilderContext context(graph.get(), &nodes, &input_names);
+  moco::tf::GraphBuilderContext context(graph.get(), &nodes, &input_names, &updates);
 
   ASSERT_EQ(context.graph(), graph.get());
   ASSERT_EQ(context.nodes(), &nodes);
   ASSERT_EQ(context.input_names(), &input_names);
+  ASSERT_EQ(context.updates(), &updates);
 }
 
 TEST(SymbolTable, node_name)