From 41de5976231ec0ab5fd3ee0dfe6862a039d15059 Mon Sep 17 00:00:00 2001 From: Lukas Geiger Date: Wed, 7 Oct 2020 15:41:54 +0100 Subject: [PATCH] Run LCE optimize pass before and after TFLite optimize pass --- larq_compute_engine/mlir/tf_tfl_passes.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/larq_compute_engine/mlir/tf_tfl_passes.cc b/larq_compute_engine/mlir/tf_tfl_passes.cc index d286f6ddb..2ec789eee 100644 --- a/larq_compute_engine/mlir/tf_tfl_passes.cc +++ b/larq_compute_engine/mlir/tf_tfl_passes.cc @@ -119,6 +119,7 @@ void AddTFToLCETFLConversionPasses( // Add a shape inference pass to optimize away the unnecessary casts. pass_manager->addPass(mlir::TF::CreateTFShapeInferencePass()); pass_manager->addPass(mlir::TFL::CreateLegalizeTFPass(true)); + pass_manager->addPass(mlir::TFL::CreateOptimizeLCEPass(false)); pass_manager->addPass(mlir::TFL::CreateOptimizePass()); pass_manager->addPass(mlir::TFL::CreateOptimizeLCEPass( experimental_enable_bitpacked_activations));