Skip to content

Commit c07d019

Browse files
Add separate test to check case when requantize cannot be fused with MIN/MAX + CLIP
1 parent c28aee2 commit c07d019

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tests/python/contrib/test_ethosu/test_legalize.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -888,7 +888,7 @@ def verify(ext_func):
888888
([1, 4, 4], [4, 1], False),
889889
],
890890
)
891-
@pytest.mark.parametrize("activation_function", [None, tf.nn.relu, tf.nn.relu6, relu_n1_to_1])
891+
@pytest.mark.parametrize("activation_function", [None, tf.nn.relu])
892892
def test_tflite_binary_elemwise_legalize(
893893
operator_type,
894894
ifm_shape,
@@ -1072,6 +1072,12 @@ def verify(ext_func):
10721072
verify(mod["tvmgen_default_ethos_u_main_0"])
10731073

10741074

1075+
# This test is for checking the case when requantize cannot be fused with MIN/MAX + CLIP due to hardware constraints.
1076+
def test_tflite_max_relu_n1_to_1_legalize():
1077+
ifm_shape = [1, 4, 8, 16]
1078+
test_tflite_binary_elemwise_legalize("MAX", ifm_shape, ifm_shape, False, relu_n1_to_1)
1079+
1080+
10751081
def test_binary_add_from_constant_scalar():
10761082
dtype = "uint8"
10771083
ifm_shape = (1, 4, 4, 8)

0 commit comments

Comments
 (0)