Skip to content

Commit

Permalink
Add separate test to check case when requantize cannot be fused with …
Browse files Browse the repository at this point in the history
…MIN/MAX + CLIP
  • Loading branch information
Aleksei-grovety committed Jan 18, 2023
1 parent c28aee2 commit c07d019
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tests/python/contrib/test_ethosu/test_legalize.py
Original file line number Diff line number Diff line change
Expand Up @@ -888,7 +888,7 @@ def verify(ext_func):
([1, 4, 4], [4, 1], False),
],
)
@pytest.mark.parametrize("activation_function", [None, tf.nn.relu, tf.nn.relu6, relu_n1_to_1])
@pytest.mark.parametrize("activation_function", [None, tf.nn.relu])
def test_tflite_binary_elemwise_legalize(
operator_type,
ifm_shape,
Expand Down Expand Up @@ -1072,6 +1072,12 @@ def verify(ext_func):
verify(mod["tvmgen_default_ethos_u_main_0"])


# This test is for checking the case when requantize cannot be fused with MIN/MAX + CLIP due to hardware constraints.
def test_tflite_max_relu_n1_to_1_legalize():
ifm_shape = [1, 4, 8, 16]
test_tflite_binary_elemwise_legalize("MAX", ifm_shape, ifm_shape, False, relu_n1_to_1)


def test_binary_add_from_constant_scalar():
dtype = "uint8"
ifm_shape = (1, 4, 4, 8)
Expand Down

0 comments on commit c07d019

Please sign in to comment.