[exo] renaming template type and node name (#8483)
author윤현식/On-Device Lab(SR)/Principal Engineer/삼성전자 <hyunsik.yoon@samsung.com>
Sun, 27 Oct 2019 21:28:16 +0000 (06:28 +0900)
committer박세희/On-Device Lab(SR)/Principal Engineer/삼성전자 <saehie.park@samsung.com>
Sun, 27 Oct 2019 21:28:16 +0000 (06:28 +0900)
Instead of trying to imply real type of template type,
general T is used and static_assert was added to explicitly show allowed type.

Signed-off-by: Hyun Sik Yoon <hyunsik.yoon@samsung.com>
compiler/exo/src/Pass/FuseBiasAddPass.test.cpp

index c63b673..6ba728d 100644 (file)
@@ -63,9 +63,12 @@ void init(locoex::TFLConv2D *conv2d, locoex::TFLConst *filter, locoex::TFLConst
   }
 }
 
-template <class AddSubT> void init(AddSubT *add_sub, locoex::FusedActFunc f)
+template <class T> void init(T *node, locoex::FusedActFunc f)
 {
-  add_sub->fusedActivationFunction(f);
+  static_assert(std::is_same<T, locoex::TFLAdd>::value || std::is_same<T, locoex::TFLSub>::value,
+                "wrong template type");
+
+  node->fusedActivationFunction(f);
 }
 
 /// @brief Initializes one param of TFLAdd or TFLSub