Skip to content

Commit

Permalink
Added opfusion before doing layout inference
Browse files Browse the repository at this point in the history
Added normalization op fusion

Type: Code Improvement
Signed-off-by: Feiyue Chen <[email protected]>
  • Loading branch information
chenfeiyue-cfy authored and sunshinemyson committed Aug 14, 2023
1 parent 4bf1e87 commit b241317
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions delegate_main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit b241317

Please sign in to comment.