You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2022/05/25 12:11:55 UTC
[GitHub] [tvm] NicolaLancellotti commented on a diff in pull request #11249: [TFLite] Support quantised SQUARED_DIFFERENCE operator
NicolaLancellotti commented on code in PR #11249:
URL: https://github.com/apache/tvm/pull/11249#discussion_r881574801
##########
tests/python/frontend/tflite/test_forward.py:
##########
@@ -270,6 +270,7 @@ def compare_tflite_with_tvm(
input_range=None,
mode="graph_executor",
experimental_new_converter=False,
+ experimental_new_quantizer=False,
Review Comment:
Duplicate line.
##########
python/tvm/relay/frontend/tflite.py:
##########
@@ -1370,11 +1378,7 @@ def convert_greater(self, op):
def convert_squared_difference(self, op):
"""Convert TFLite SQUARED DIFFERENCE"""
# Check if the input tensor is quantized, call QNN op
- if self.is_quantized(op):
- raise tvm.error.OpNotImplemented(
- "TFlite quantized squared difference operator is not supported yet."
- )
- difference = self._convert_elemwise(_op.subtract, op)
+ difference = self._convert_elemwise(_op.subtract, op, dequantize=True)
Review Comment:
Shouldn't there be a check like the following?
```suggestion
difference = self._convert_elemwise(_op.subtract, op, dequantize=self.is_quantized(op))
```
##########
tests/python/frontend/tflite/test_forward.py:
##########
@@ -2135,6 +2138,7 @@ def __test_elemwise(in_data):
quantized=True,
input_range=input_range,
experimental_new_converter=same_qnn_params,
+ experimental_new_quantizer=experimental_new_quantizer,
Review Comment:
I think the previous line should be removed.
##########
tests/python/frontend/tflite/test_forward.py:
##########
@@ -286,6 +287,7 @@ def compare_tflite_with_tvm(
# convert to tflite model
converter = tf.lite.TFLiteConverter.from_session(sess, input_tensors, output_tensors)
converter.experimental_new_converter = experimental_new_converter
+ converter.experimental_new_quantizer = experimental_new_quantizer
Review Comment:
Duplicate line.
--
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.
To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org