tensorflow/compiler/mlir/lite/experimental/tac/py_wrapper/tac_wrapper.cc
// Run target-aware-conversion for the given tflite model with the given device
// specs.
// Warning: The API is experimental and subject to changes.
Run target-aware-conversion for the given tflite model with the given device
specs.
Warning: The API is experimental and subject to changes.
Run target - aware - conversion for the given tflite model with the given device specs . Warning : The API is experimental and subject to changes .
bool run_tac(const std::string& model_file_path,
             const std::vector<std::string>& device_specs,
             const std::string& model_output_path) {
  mlir::TFL::tac::TacModule::Options options;
  options.hardware_backends = device_specs;
  options.enable_inliner = true;
  options.legalize_to_tflite_ops = true;
  mlir::TFL::tac::TacModule tac_module(options);
  mlir::DialectRegistry registry;
  mlir::RegisterAllTensorFlowDialects(registry);
  tac_module.RegisterExtraDialects(registry);
  tac_module.SetImporter(CreateTfLiteImporter(model_file_path));
  tac_module.SetExporter(
      CreateTfLiteExporter(model_output_path, options.hardware_backends));
  return tac_module.Run().ok();
}
bool run_tac ( const std :: string & model_file_path , const std :: vector < std :: string > & device_specs , const std :: string & model_output_path ) { mlir :: TFL :: tac :: TacModule :: Options options ; options . hardware_backends = device_specs ; options . enable_inliner = true ; options . legalize_to_tflite_ops = true ; mlir :: TFL :: tac :: TacModule tac_module ( options ) ; mlir :: DialectRegistry registry ; mlir :: RegisterAllTensorFlowDialects ( registry ) ; tac_module . RegisterExtraDialects ( registry ) ; tac_module . SetImporter ( CreateTfLiteImporter ( model_file_path ) ) ; tac_module . SetExporter ( CreateTfLiteExporter ( model_output_path , options . hardware_backends ) ) ; return tac_module . Run ( ) . ok ( ) ; }
Run target-aware-conversion for the given tflite model with the given device
specs.
Run target - aware - conversion for the given tflite model with the given device specs .