TFLite Converter (MLIR) cannot correctly generate graph for Dense layer with input rank 3
@hayhan Could you verify if the values in the empty shape tensor should be [1, -1] (assuming batch size 1 and dynamic sequence length)? If so, manually setting these values after conversion might resolve the issue?
Also try to refer to custom TFLite delegates that handle rank 3 inputs for Dense layers more efficiently.
Thank you! @sushreebarsa Thanks for your comment and suggestions. After some investigation, I realized my issue can be fixed by saving the SavedModel with signatures before the converting. I had some signature configuration issue several days ago. Now it's done. Thank you again.

----------------
model.save(path_to_model, save_format='tf', signatures=signatures)
tf.lite.TFLiteConverter.from_saved_model(path_to_model)
tflite_model = converter.convert()
...

### 1. System information

- OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Ubuntu 20.04
- TensorFlow installation (pip package or built from source): pip
- TensorFlow library (version, if pip package or github SHA, if built from source): 2.15.0

### 2. Code

https://gist.github.com/hayhan/7cc157f0b8542cf84b53c2bbaf014dd1

### 3. Failure after conversion

A simple example model can present the issue. See the code link above. Input with rank 2 --> Embedding layer (output rank 3) --> Dense layer. The generated node for Dense layer is broken into several raw OPs. Pay attention to the Reshape OP in the red circle. The shape tensor in this node is int32[2] **BUT no data in it**. When TFLite interpreter loads / builds tensors for the TFLite model, it thinks this shape tensor is dynamic sized and refuses to delegate the corresponding Reshape OP using XNNPACK. The 3rd vendor inference HW will do similar thing as XNNPACK does, so no HW accelerations.

I found the old Converter (TOCO) has no such issue by adding two options (in version 2.15.0) below before converting. It generates the expected graph but has deprecated warnings. See the attached snapshot.
/////////////
converter.experimental_new_converter = False
converter.experimental_new_quantizer = False

If the issue happens at the model input, e.g. rank 3 input to Dense layer at the very 1st layer, I can workaround the issue by using signature/concrete_functions (set batch size to 1) when initializing the converter. But if the issue happens at other positions in the model, e.g. BERT model, the workaround will not work.
concrete_func.inputs[0].set_shape([**1**, 5, 4])

Is this a real issue or did I miss something to correctly using the TFLite Converter (MLIR)?

**TFLite graph (MLIR, with 2.15.0)**
![image](https://github.com/tensorflow/tensorflow/assets/45869898/f937d381-22c0-4694-b19c-2ad2291ba485)



**TFLite graph (TOCO, with 2.15.0)**
![image](https://github.com/tensorflow/tensorflow/assets/45869898/c6f78c2e-8593-4b00-b31c-6f07788a89b9)

Thanks


