[exo] revising TestGraph.h (#8618)
author윤현식/On-Device Lab(SR)/Principal Engineer/삼성전자 <hyunsik.yoon@samsung.com>
Wed, 30 Oct 2019 22:00:39 +0000 (07:00 +0900)
committer박세희/On-Device Lab(SR)/Principal Engineer/삼성전자 <saehie.park@samsung.com>
Wed, 30 Oct 2019 22:00:39 +0000 (07:00 +0900)
This revises TestGraph.h to 1) remove build() and 2) remove graph().
1) build() is moved into constructor
2) graph() is already defined in parent

Signed-off-by: Hyun Sik Yoon <hyunsik.yoon@samsung.com>
compiler/exo/src/Conversion/ConstGenConverter.test.cpp
compiler/exo/src/Conversion/FeatureBiasAddConverter.test.cpp
compiler/exo/src/TestGraph.h

index 9d46545..f7a5772 100644 (file)
@@ -28,7 +28,6 @@
 TEST(TFLConstGenConverterTest, ConstGen_Relu)
 {
   exo::test::ExampleGraph<exo::test::ExampleGraphType::ConstGen_ReLU> g;
-  g.build();
 
   // set constgen
   {
index b00d0be..f3c4a5f 100644 (file)
@@ -29,7 +29,6 @@
 TEST(FeatureBiasAddConverterTest, basic_test)
 {
   exo::test::ExampleGraph<exo::test::ExampleGraphType::FeatureBiasAdd> g;
-  g.build();
 
   { // attrib setting
     // pull
index 3942055..f919cc9 100644 (file)
@@ -219,11 +219,7 @@ public:
   loco::FeatureDecode *fea_dec = nullptr;
 
 public:
-  ExampleGraph() = default;
-
-  loco::Graph *graph() { return g.get(); }
-
-  void build()
+  ExampleGraph()
   {
     fea_enc = exo::make_feature_encode<exo::FeatureLayout::NHWC>(pull);
     constgen = append<loco::ConstGen>();
@@ -246,17 +242,11 @@ public:
   loco::ReLU *relu = nullptr;
 
 public:
-  ExampleGraph() = default;
-
-  loco::Graph *graph() { return g.get(); }
-
-  void build()
+  ExampleGraph()
   {
     constgen = append<loco::ConstGen>();
     relu = append<loco::ReLU>(constgen);
     complete(relu);
-
-    EXO_TEST_ASSERT_NODE_COUNT({push}, 3); // sanity check
   }
 };
 
@@ -276,8 +266,6 @@ public:
     transpose = append<loco::TensorTranspose>(pull);
     complete(transpose);
   }
-
-  loco::Graph *graph() { return g.get(); }
 };
 
 /**
@@ -299,8 +287,6 @@ public:
         exo::make_filter_decode<exo::FilterLayout::OHWI>(filterEncode); // to Tensorflow Lite
     complete(filterDecode);
   }
-
-  loco::Graph *graph() { return g.get(); }
 };
 
 /**
@@ -321,8 +307,6 @@ public:
     tfl_transpose = append<locoex::TFLTranspose>(pull, const_perm);
     complete(tfl_transpose);
   }
-
-  loco::Graph *graph() { return g.get(); }
 };
 
 } // namespace test