[exo-tflite] Moving Knob check of each converter into convert.cpp (#7303)
author윤현식/On-Device Lab(SR)/Principal Engineer/삼성전자 <hyunsik.yoon@samsung.com>
Mon, 9 Sep 2019 23:39:18 +0000 (08:39 +0900)
committer박종현/On-Device Lab(SR)/Staff Engineer/삼성전자 <jh1302.park@samsung.com>
Mon, 9 Sep 2019 23:39:18 +0000 (08:39 +0900)
* [exo-tflite] Moving Knob check of each converter into convert.cpp

Knob check of each converter was moved into `convert.cpp`.

Signed-off-by: Hyun Sik Yoon <hyunsik.yoon@samsung.com>
* remove unused header

compiler/exo-tflite/src/Conversion/ReluConverter.cpp
compiler/exo-tflite/src/Convert.cpp

index 6eb344f..a0ac1f7 100644 (file)
@@ -17,9 +17,7 @@
 #include "ReluConverter.h"
 
 #include "GraphBlock.h"
-#include "Knob.h"
 #include "Check.h"
-#include "Log.h"
 
 #include "Dialect/IR/TFLNodes.h"
 
@@ -30,16 +28,6 @@ namespace exo
 
 bool ReluConverter::convert(loco::ReLU *origin)
 {
-  LOGGER(l);
-
-  if (!get_knob<Knob::ConvertRelu>()) // for backward compatibility
-  {
-    INFO(l) << "Knob::ConvertRelu is NOT set.";
-    return false;
-  }
-
-  INFO(l) << "Knob::ConvertRelu is set.";
-
   if (!loco::shape_known(origin))
   {
     return false;
index e4b9eca..c97a64c 100644 (file)
@@ -21,6 +21,7 @@
 #include "Conversion/TypeInferencePass.h"
 #include "Conversion/ShapeInferencePass.h"
 #include "ProgressReporter.h"
+#include "Knob.h"
 
 #include <loco.h>
 #include <loco/Service/ShapeInference.h>
@@ -62,7 +63,10 @@ void convert_to_TFLNodes(loco::Graph *graph)
     // TODO loco::FeatureBiasAdd
     // TODO loco::FixedReshape
     // TODO loco::MaxPool2D
-    phase.emplace_back(stdex::make_unique<ReluConverter>());
+
+    if (get_knob<Knob::ConvertRelu>())
+      phase.emplace_back(stdex::make_unique<ReluConverter>());
+
     // TODO loco::ReLU6
     // TODO loco::Tanh
     // TODO loco::TensorConcat