Add a flag for enabling/disabling legalize tf while pass in tf_tfl_translate
PiperOrigin-RevId: 302770363 Change-Id: I7ad5da21972e0f270cd217ba813d38fb5d6b858d
This commit is contained in:
parent
673bac75fd
commit
4a12b6f8d1
tensorflow/compiler/mlir/lite
@ -195,6 +195,7 @@ int main(int argc, char **argv) {
|
||||
mlir::TFL::PassConfig pass_config(quant_specs);
|
||||
pass_config.emit_builtin_tflite_ops = emit_builtin_tflite_ops;
|
||||
pass_config.lower_tensor_list_ops = lower_tensor_list_ops;
|
||||
pass_config.legalize_tf_while = convert_tf_while_to_tfl_while;
|
||||
|
||||
// Currently we only do shape inference for saved model import.
|
||||
if (import_saved_model_object_graph || import_saved_model_signature_defs) {
|
||||
|
@ -105,7 +105,7 @@ opt<std::string> quant_stats_file_name("quant-stats",
|
||||
llvm::cl::init(""));
|
||||
|
||||
// NOLINTNEXTLINE
|
||||
opt<bool> legalize_while(
|
||||
"legalize-tf-while",
|
||||
opt<bool> convert_tf_while_to_tfl_while(
|
||||
"convert_tf_while_to_tfl_while",
|
||||
llvm::cl::desc("Whether to legalize TF While to TFL While."),
|
||||
llvm::cl::init(false));
|
||||
llvm::cl::init(true));
|
||||
|
@ -38,6 +38,7 @@ extern llvm::cl::opt<bool> output_mlir;
|
||||
extern llvm::cl::list<std::string> custom_opdefs;
|
||||
extern llvm::cl::opt<bool> emit_quant_adaptor_ops;
|
||||
extern llvm::cl::opt<std::string> quant_stats_file_name;
|
||||
extern llvm::cl::opt<bool> convert_tf_while_to_tfl_while;
|
||||
|
||||
// Import saved model.
|
||||
extern llvm::cl::opt<bool> import_saved_model_object_graph;
|
||||
|
Loading…
Reference in New Issue
Block a user