From b2413178d96cb19815f189294c13c1e6fb70aa19 Mon Sep 17 00:00:00 2001 From: Feiyue Chen Date: Mon, 7 Aug 2023 06:15:04 +0000 Subject: [PATCH] Added opfusion before doing layout inference Added normalization op fusion Type: Code Improvement Signed-off-by: Feiyue Chen --- delegate_main.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/delegate_main.cc b/delegate_main.cc index fb288d6..f2e4980 100644 --- a/delegate_main.cc +++ b/delegate_main.cc @@ -39,6 +39,7 @@ #include "tensorflow/lite/kernels/internal/tensor_ctypes.h" #include "tensorflow/lite/kernels/internal/types.h" #include "tim/transform/layout_inference.h" +#include "tim/transform/mean_stddev_normalize_fusion.h" using namespace tflite; namespace { @@ -636,6 +637,8 @@ TfLiteStatus Delegate::Invoke(const OpData& op_data, } TFLITE_LOG(TFLITE_LOG_INFO, "Verifying graph"); + // Do normalization op fusion before layout inference + tim::transform::MeanStdDevNormalization(graph_); // Do layout inference and get a new graph(first) and a tensor map(second). layout_infered_ = tim::transform::LayoutInference(graph_, context_); #ifdef MULTI_DEVICE_FEATURE_MODE