Missing support for type `tf.float64`  from c++ tflite inference
Hi @pkgoogle,

I have reproduced the code with some basic functions using python. The main observations here are that with float32 for few random inputs the precision lost and for few preserves. For flaot64, the precision preserves for all random inputs. The code throws a value error upon adding ```converter.inference_input_type = tf.float64 ,
converter.inference_output_type = tf.float64``` lines. Might require feature support for float64. Please find the [gist](https://colab.research.google.com/gist/LakshmiKalaKadali/e296117af1c35dd222ef1fe87908cae5/-62729.ipynb).

Thank You
 Hi @SanjayMarreddi, I don't believe we support float64 for tflite ... generally speaking, mobile & edge operates with memory and latency constraints so we generally try to do the opposite -- try to support lower precision models and quantization. @miaout17 will we support this in the future? Thanks. Hi @pkgoogle, Thanks a lot for the response. Yeah, I can understand that. 

The reason I was looking to use `tflite` format model is to reduce some latency overhead for the inference of the `tensorflow` models from Java and C++.  And also high precision is needed.

Do you / @miaout17 have any idea on whether `tf.float64` would be supported anytime soon in the future?

Any other suggestions are also highly appreciated. Thanks!



### 1. System information

- OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Ubuntu 22.04
- TensorFlow installation (pip package or built from source): pip

### 2. Details

- I have a small tensorflow model created with pure tensor operations. I am converting the python model into the `.tflite` format. 
- Then I am doing the inference on the model from [python](https://www.tensorflow.org/lite/guide/signatures#python) and [c++](https://www.tensorflow.org/lite/guide/signatures#c) using the sample codes linked from documentation.
- Basic model architecture:
```
class Model(tf.Module):
  @tf.function(input_signature=[tf.TensorSpec(shape=[None], dtype=tf.float32)])           # ---> Line 2
  def solve(self, x):
    ...
    ...
    return y


# Save the model in the usual way:
model = Model()
SAVED_MODEL_PATH = 'updated_model'
tf.saved_model.save(
model, SAVED_MODEL_PATH,
signatures={
    'solve': model.solve.get_concrete_function()
})

# The way I am converting the model:
converter = tf.lite.TFLiteConverter.from_saved_model(SAVED_MODEL_PATH)
converter.target_spec.supported_ops = [
tf.lite.OpsSet.TFLITE_BUILTINS,
tf.lite.OpsSet.SELECT_TF_OPS 
]
tflite_model = converter.convert()
with open('model.tflite', 'wb') as f:
  f.write(tflite_model)
```
### 3. There are 3 specific cases I tested:

1. With the above code model structure and conversion, both C++ inference and python inference are working. But both are giving the values with less precision ( 2-3 decimal places ). 
2. As I need more precision,  I have changed the line `2` above to use `tf.float64`. The conversion is successful.
   - Then, the python inference works again, **but with values of high precision, 6-8 decimal places.  ( The same is desired in C++)** 
   - But the C++ inference gives Segmentation fault.
 3. In addition to the test 2 change, I have added the below 2 lines specifying the type before converting:
```
converter = tf.lite.TFLiteConverter.from_saved_model(SAVED_MODEL_PATH)
converter.target_spec.supported_ops = [
tf.lite.OpsSet.TFLITE_BUILTINS, 
tf.lite.OpsSet.SELECT_TF_OPS
]
converter.inference_input_type = tf.float64    # Added lines
converter.inference_output_type = tf.float64
tflite_model = converter.convert()
```
The error it gives DURING CONVERSION:
```
Traceback (most recent call last):
  File "/home/smarreddi/dev/analytics/price_estimator/fairpriceaggregator/model_generator/save_and_convert.py", line 66, in <module>
    tflite_model = converter.convert()
  File "/home/smarreddi/miniconda3/envs/tf/lib/python3.9/site-packages/tensorflow/lite/python/lite.py", line 1065, in wrapper
    return self._convert_and_export_metrics(convert_func, *args, **kwargs)
  File "/home/smarreddi/miniconda3/envs/tf/lib/python3.9/site-packages/tensorflow/lite/python/lite.py", line 1042, in _convert_and_export_metrics
    result = convert_func(self, *args, **kwargs)
  File "/home/smarreddi/miniconda3/envs/tf/lib/python3.9/site-packages/tensorflow/lite/python/lite.py", line 1390, in convert
    return self._convert_from_saved_model(graph_def)
  File "/home/smarreddi/miniconda3/envs/tf/lib/python3.9/site-packages/tensorflow/lite/python/lite.py", line 1247, in _convert_from_saved_model
    self._validate_inference_input_output_types(quant_mode)
  File "/home/smarreddi/miniconda3/envs/tf/lib/python3.9/site-packages/tensorflow/lite/python/lite.py", line 1103, in _validate_inference_input_output_types
    raise ValueError(
ValueError: The inference_input_type and inference_output_type must be tf.float32.
```

I would like to understand why the type `tf.float32` is only allowed in the c++ inference path. I would like to attain the high precision like the python inference in the C++ as well ( like test case 2 ).

Let me know your thoughts on the same @tflite-support-robot, community

Thanks!