Disable shape inference on import in ConvertFunctionToMlir.
Shape inference on import is deprecated in favor of shape inference pass.
PiperOrigin-RevId: 346835235
Change-Id: I38e67f9b87442d00680ad5d76e5d8c74e9ca7f69
diff --git a/tensorflow/compiler/mlir/tensorflow/translate/import_model.cc b/tensorflow/compiler/mlir/tensorflow/translate/import_model.cc
index 4d33308..53c7355 100644
--- a/tensorflow/compiler/mlir/tensorflow/translate/import_model.cc
+++ b/tensorflow/compiler/mlir/tensorflow/translate/import_model.cc
@@ -3733,6 +3733,7 @@
mlir::MLIRContext* context) {
tensorflow::GraphDebugInfo dummy_debug_info;
tensorflow::GraphImportConfig specs;
+ specs.enable_shape_inference = false;
specs.graph_as_function = true;
for (const auto* control_ret_node : fbody->control_ret_nodes)
specs.control_outputs.push_back(control_ret_node->name());