From e823c778d320cf6b85f5218951f08442da15f2a5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=EC=9C=A4=ED=98=84=EC=8B=9D/On-Device=20Lab=28SR=29/Princip?= =?utf8?q?al=20Engineer/=EC=82=BC=EC=84=B1=EC=A0=84=EC=9E=90?= Date: Fri, 25 Oct 2019 15:22:38 +0900 Subject: [PATCH] [exo] setting FusedActFunc of TFLAdd and TFLSub with init() function (#8454) This adds init() method that sets FusedActFunc of TFLAdd and TFLSub Signed-off-by: Hyun Sik Yoon --- compiler/exo/src/Pass/FuseBiasAddPass.test.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/compiler/exo/src/Pass/FuseBiasAddPass.test.cpp b/compiler/exo/src/Pass/FuseBiasAddPass.test.cpp index 58c09bf..c63b673 100644 --- a/compiler/exo/src/Pass/FuseBiasAddPass.test.cpp +++ b/compiler/exo/src/Pass/FuseBiasAddPass.test.cpp @@ -63,6 +63,11 @@ void init(locoex::TFLConv2D *conv2d, locoex::TFLConst *filter, locoex::TFLConst } } +template void init(AddSubT *add_sub, locoex::FusedActFunc f) +{ + add_sub->fusedActivationFunction(f); +} + /// @brief Initializes one param of TFLAdd or TFLSub void init(locoex::TFLConst *addsub_param) { @@ -97,8 +102,8 @@ TEST(FuseBiasAddPassTest, Conv2D_Add_01_basic) init(g.pull); init(conv2d, filter, bias); + init(add, locoex::FusedActFunc::NONE); init(add_y); - add->fusedActivationFunction(locoex::FusedActFunc::NONE); // let's run fusion { @@ -150,7 +155,7 @@ TEST(FuseBiasAddPassTest, Conv2D_Add_02_TFLAdd_y_is_scalar) add_y->size(1); add_y->at(0) = 1.5; } - add->fusedActivationFunction(locoex::FusedActFunc::NONE); + init(add, locoex::FusedActFunc::NONE); // let's run fusion { @@ -193,6 +198,7 @@ TEST(FuseBiasAddPassTest, Conv2D_Sub_01_basic) init(g.pull); init(conv2d, filter, bias); + init(sub, locoex::FusedActFunc::NONE); init(sub_y); // let's run fusion @@ -236,6 +242,7 @@ TEST(FuseBiasAddPassTest, Conv2D_Sub_02_fusing_will_not_performed) init(g.pull); init(conv2d, filter, bias); + init(sub, locoex::FusedActFunc::NONE); init(sub_y); // let's run fusion @@ -280,11 +287,11 @@ TEST(FuseBiasAddPassTest, Regression_Conv2D_Add_fused_action_00) init(g.pull); init(conv2d, filter, bias); + init(add, locoex::FusedActFunc::NONE); init(add_y); // Updating Fused Activation for this test conv2d->fusedActivationFunction(locoex::FusedActFunc::RELU); - add->fusedActivationFunction(locoex::FusedActFunc::NONE); // let's run fusion { @@ -324,8 +331,8 @@ TEST(FuseBiasAddPassTest, Regression_Conv2D_Add_fused_action_01) init(g.pull); init(conv2d, filter, bias); + init(add, locoex::FusedActFunc::RELU); init(add_y); - add->fusedActivationFunction(locoex::FusedActFunc::RELU); // let's run fusion { -- 2.7.4