From 7ef7f8c115b10d6b8455a71c2f4f93d54d06599d Mon Sep 17 00:00:00 2001 From: SaeHie Park Date: Tue, 3 Dec 2024 08:21:00 +0900 Subject: [PATCH] [luci/pass] Revise FuseInstanceNormPass V6 This will revise FuseInstanceNormPass version_6 to have const_as_beta as zero values. ONE-DCO-1.0-Signed-off-by: SaeHie Park --- compiler/luci/pass/src/FuseInstanceNormPass.cpp | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/compiler/luci/pass/src/FuseInstanceNormPass.cpp b/compiler/luci/pass/src/FuseInstanceNormPass.cpp index 4bbf8192967..438cb340087 100644 --- a/compiler/luci/pass/src/FuseInstanceNormPass.cpp +++ b/compiler/luci/pass/src/FuseInstanceNormPass.cpp @@ -362,7 +362,7 @@ namespace * V V V | * mul_as_scaled_ifm mul_as_scaled_mean <-------------+ * | | - * | const_as_beta | + * | const_zero | * | | V * | +------> sub * V | @@ -721,16 +721,6 @@ template <> bool InstanceNormPattern::matchinput()); - // If const_as_beta has shape of '1 x chennel x (1 or input last dimension)' - uint32_t input_channel = ifm_circle->dim(1).value(); - uint32_t input_last_dim = ifm_circle->dim(2).value(); - const_as_beta = dynamic_cast(sub->x()); - CHECK_OR_FALSE(const_as_beta); - CHECK_OR_FALSE(const_as_beta->rank() == 3); - CHECK_OR_FALSE( - const_as_beta->dim(0).value() == 1 && const_as_beta->dim(1).value() == input_channel && - (const_as_beta->dim(2).value() == 1 || const_as_beta->dim(2).value() == input_last_dim)); - luci::CircleRsqrt *rsqrt_should_be = nullptr; luci::CircleMean *mean_of_ifm_should_be = nullptr; @@ -741,11 +731,12 @@ template <> bool InstanceNormPattern::matchgraph(); const_as_gamma = make_const_one(graph, 1.0f); const_as_gamma->name(add_as_terminal->name() + "/gamma"); + const_as_beta = make_const_one(graph, 0.0f); + const_as_beta->name(add_as_terminal->name() + "/beta"); _matched = true; return true;