Lunderberg commented on code in PR #15844:
URL: https://github.com/apache/tvm/pull/15844#discussion_r1344178068
##########
tests/python/frontend/tflite/test_forward.py:
##########
@@ -2480,6 +2481,16 @@ def __test_elemwise(in_data):
inq0_min, inq0_max = (out_min, out_max)
inq1_min, inq1_max = (out_min, out_max)
+ if exclude_zero_point:
+ if inq1_max == inq1_min:
+ raise ZeroDivisionError("Input range is 0.")
+
+ # only compute for rhs.
+ quant_scale = 255 / (inq1_max - inq1_min)
+ zero_point = int(round(-inq1_min * quant_scale))
+ data[1][data[1] == zero_point] += 1
+ data[1][data[1] == 0] += 1
Review Comment:
Interesting, and thank you for checking. Possibly due to tests that
quantize one or the other argument, leading `data` to be used in both contexts.
--
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]