inadob commented on a change in pull request #4696: [Relay][Frontend][TFlite]
Add support for quantized LOGISTIC
URL: https://github.com/apache/incubator-tvm/pull/4696#discussion_r374712987
##########
File path: tests/python/frontend/tflite/test_forward.py
##########
@@ -143,11 +144,13 @@ def compare_tflite_with_tvm(in_data, in_name,
input_tensors,
converter.inference_type = tf.lite.constants.QUANTIZED_UINT8
input_arrays = converter.get_input_arrays()
input_stats = {}
- # hardcode the mean_values and std_dev_values (m,s) to be the same
- # if all inputs are in (float_min; float_max) == (-100, 100)
+ # calculate the mean and quantization scale for every input tensor,
+ # with respect to its fp32 input range, defined in fake_quant.
# s = 255/(fmax-fmin); m = -fmin*s (the zero point)
for i in input_arrays:
- input_stats[i] = (128., 1.275)
+ quant_scale = 255 / (input_range[i][1] - input_range[i][0])
Review comment:
I updated this here #4789. Once we agree on the changes in that PR, I will
update all the others depending on it.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services