Skip to content

Commit

Permalink
Update test_forward.py
Browse files Browse the repository at this point in the history
  • Loading branch information
tlopex authored Sep 28, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 9e885c1 commit 5921ba7
Showing 1 changed file with 9 additions and 19 deletions.
28 changes: 9 additions & 19 deletions tests/python/frontend/tflite/test_forward.py
Original file line number Diff line number Diff line change
@@ -2847,25 +2847,15 @@ def _test_forward_elemwise(testop):
def _test_forward_elemwise_quantized(testop, dtype=np.uint8):
type_info = np.iinfo(dtype)
_min, _max = type_info.min, type_info.max
if testop.__name__ == _test_pow.__name__:
testop(
[
np.array(np.random.uniform(-3, 3, (3, 6)), dtype=dtype),
np.array(np.random.uniform(-3, 3, (3, 6)), dtype=dtype),
],
quantized=True,
qnn_op=testop,
)
# np.uint8 0-255
else:
testop(
[
np.array(np.random.uniform(_min, _max, (3, 6)), dtype=dtype),
np.array(np.random.uniform(_min, _max, (3, 6)), dtype=dtype),
],
quantized=True,
qnn_op=testop,
)
testop(
[
np.array(np.random.uniform(_min, _max, (3, 6)), dtype=dtype),
np.array(np.random.uniform(_min, _max, (3, 6)), dtype=dtype),
],
quantized=True,
qnn_op=testop,
)


def _test_elemwise_qnn_out_range(qnn_op):
@@ -2884,7 +2874,7 @@ def _test_elemwise_qnn_out_range(qnn_op):
_test_less: (-150, 150),
_test_floor_mod: (-150, 150),
_test_not_equal: (-150, 150),
_test_pow: (-2, 2),
_test_pow: (-26, 26),
_test_less_equal: (-150, 150),
_test_greater_equal: (-150, 150),
}

0 comments on commit 5921ba7

Please sign in to comment.