SebastianBoblest commented on code in PR #12028:
URL: https://github.com/apache/tvm/pull/12028#discussion_r915691941
##########
tests/python/frontend/tflite/test_forward.py:
##########
@@ -2212,50 +2227,37 @@ def __test_elemwise(in_data):
for x in zip(
in_data, (("inq_0", (inq0_min, inq0_max)), ("inq_1",
(inq1_min, inq1_max)))
)
- if None != x[0]
+ if x[0] != None
}
if math_op is math_ops.equal:
out = math_op(inq_data[0], inq_data[1])
out = with_fused_activation_function(out,
fused_activation_function)
- compare_tflite_with_tvm(
- [x[1] for x in zip(in_data, data) if None != x[0]],
- [x + ":0" for x in input_range.keys()],
- [x[1] for x in zip(in_data, inq_data) if None != x[0]],
- [out],
- )
- else:
- out = math_op(inq_data[0], inq_data[1])
- out = with_fused_activation_function(out,
fused_activation_function)
- out = tf.quantization.fake_quant_with_min_max_args(
- out, min=out_min, max=out_max, name="out"
- )
-
- # Note same_qnn_params uses experimental_new_converter as toco
failed
- compare_tflite_with_tvm(
- [x[1] for x in zip(in_data, data) if None != x[0]],
- [x + ":0" for x in input_range.keys()],
- [x[1] for x in zip(in_data, inq_data) if None != x[0]],
- [out],
- quantized=True,
- input_range=input_range,
- experimental_new_converter=same_qnn_params,
- )
+ # Note same_qnn_params uses experimental_new_converter as toco
failed
+ compare_tflite_with_tvm(
+ [x[1] for x in zip(in_data, data) if x[0] != None],
+ [x + ":0" for x in input_range.keys()],
+ [x[1] for x in zip(in_data, inq_data) if x[0] != None],
+ [out],
+ quantized=True,
+ input_range=input_range,
+ experimental_new_converter=same_qnn_params,
+ )
else:
out = math_op(
in_data[0]
- if None != in_data[0]
+ if in_data[0] != None
else ops.convert_to_tensor(data[0], dtype=data[0].dtype),
in_data[1]
- if None != in_data[1]
+ if in_data[1] != None
else ops.convert_to_tensor(data[1], dtype=data[1].dtype),
)
out = with_fused_activation_function(out,
fused_activation_function)
compare_tflite_with_tvm(
- [x[1] for x in zip(in_data, data) if None != x[0]],
- [x[1] for x in zip(in_data, ("in_0:0", "in_1:0")) if None !=
x[0]],
- [x for x in in_data if None != x],
+ [x[1] for x in zip(in_data, data) if x[0] != None],
Review Comment:
```suggestion
[x[1] for x in zip(in_data, data) if x[0] is not None],
```
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]