[moco-tf] Use logo for Importer (#7119)
author박세희/On-Device Lab(SR)/Principal Engineer/삼성전자 <saehie.park@samsung.com>
Wed, 4 Sep 2019 04:26:30 +0000 (13:26 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Wed, 4 Sep 2019 04:26:30 +0000 (13:26 +0900)
This will revise Importer to use logo Phase and ProgressReporter

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

index e1418fb..7899a4d 100644 (file)
@@ -20,7 +20,7 @@
 #include "GraphBuilderContext.h"
 #include "GraphBuilderRegistry.h"
 #include "Transforms.h"
-#include "Phase.h"
+#include "ProgressReporter.h"
 
 #include "Annotations/ShapeInferenceData.h"
 
@@ -30,6 +30,8 @@
 #include <locop/FormattedGraph.h>
 #include <stdex/Memory.h>
 
+#include <logo/Phase.h>
+
 #include <cassert>
 #include <sstream>
 #include <stdexcept>
@@ -213,7 +215,7 @@ void transform_graph(loco::Graph *graph)
   LOGGER(transform_graph);
 
   std::vector<std::unique_ptr<moco::tf::Transform>> prepare;
-  moco::tf::Phase transforms;
+  logo::Phase transforms;
 
   // Transforms that run only once for preparation and finalization
   {
@@ -232,8 +234,10 @@ void transform_graph(loco::Graph *graph)
     tr->run(graph);
   }
 
-  moco::tf::PhaseRunner<moco::tf::PhaseStrategy::Saturate> runner{graph};
+  moco::tf::ProgressReporter prog(graph, logo::PhaseStrategy::Saturate);
+  logo::PhaseRunner<logo::PhaseStrategy::Saturate> runner{graph};
 
+  runner.attach(&prog);
   runner.run(transforms);
 
   // TODO would be better to run this code only when log is enabled