Why does toco convert tf.squeeze to reshape operator?
Hi @0-chan-kor, I believe the answer is in the comments actually:

in https://github.com/tensorflow/tensorflow/blob/master/tensorflow/lite/toco/graph_transformations/convert_squeeze_to_reshape.cc
```
// Replaces a tf.squeeze operator with a reshape.
// Squeeze removes dimensions == 1 (if in the list of squeeze_dims). This
// means that the data layout will never change with this op, just the shape.
// By converting these to reshapes once we have run shape propagation we allow <--
// standard reshape optimization transforms to do their magic. <--
::tensorflow::Status ConvertSqueezeToReshape::Run(Model* model,
                                                  std::size_t op_index,
                                                  bool* modified) {
```

To paraphrase, "we are converting them to reshapes so that we can use standard reshape optimization transforms"

Please close if this satiates your curiosity The behavior you mentioned, where tf.squeeze() is converted to a reshape operator when using the TOCO (TensorFlow Lite Optimizing Converter) tool, is related to the optimization process performed by TOCO.

TOCO aims to optimize TensorFlow models for deployment on mobile and embedded devices using TensorFlow Lite. During the conversion process, TOCO applies a set of optimizations to reduce the model size, improve inference speed, and ensure compatibility with the target platform.

When TOCO encounters a tf.squeeze() operation during the conversion, it analyzes the operation and its inputs to determine if the operation can be equivalently represented using a reshape operation. In many cases, the removal of singleton dimensions can be achieved through a reshape operation without changing the behavior of the model.

By converting tf.squeeze() to a reshape operator, TOCO can potentially simplify the resulting model graph and eliminate the need for explicit squeeze operations, leading to improved performance or reduced memory requirements in the optimized TensorFlow Lite model.

It's important to note that the conversion behavior may vary depending on the specific versions of TensorFlow and TOCO being used. The optimization strategies employed by TOCO can evolve over time as new versions are released. This issue is stale because it has been open for 7 days with no activity. It will be closed if no further activity occurs. Thank you. This issue was closed because it has been inactive for 7 days since being marked as stale. Please reopen if you'd like to work on this further. Are you satisfied with the resolution of your issue?
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=Yes&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/60686">Yes</a>
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=No&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/60686">No</a>

### 1. System information

- latests tensorflow
- mac os (m1)

### 2. Code

This may simply be my curiosity and a question for your support. Looking at the kernel-side codes of tflite, it was found that there is a kernel implementation code for the squeeze operator(https://github.com/tensorflow/tensorflow/blob/master/tensorflow/lite/kernels/squeeze.cc
).
However, when converting tensorflow to tflite using toco, squeeze is converted to reshape by the function below.
https://github.com/tensorflow/tensorflow/blob/master/tensorflow/lite/toco/graph_transformations/convert_squeeze_to_reshape.cc

I have a question about this.

1. Are you doing this conversion for some reason, like performance?
2. If not, will this conversion logic be removed from toco so that it can be done later with the squeeze tflite kernel?

Thank you.

BR, youngchan
