aboutsummaryrefslogtreecommitdiff
path: root/ethosu/vela/test/test_tflite_model_semantic.py
diff options
context:
space:
mode:
authorFredrik Svedberg <fredrik.svedberg@arm.com>2022-09-07 16:01:15 +0200
committerFredrik Svedberg <fredrik.svedberg@arm.com>2022-09-12 10:10:14 +0000
commit701ba91870fa09e63d1ee3af6654689f78c138e8 (patch)
treee14f8e25aa2c7677e281426f65aaa7a5cf76e688 /ethosu/vela/test/test_tflite_model_semantic.py
parent9ae34556663d09cc3dff19e53e68b57c8c940565 (diff)
downloadethos-u-vela-701ba91870fa09e63d1ee3af6654689f78c138e8.tar.gz
MLBEDSW-6869 Improve LeakyRelu support
Added support for int16 LeakyRelu for negative alpha and alpha greater than one. Signed-off-by: Fredrik Svedberg <fredrik.svedberg@arm.com> Change-Id: I7f522ebfe014786d0a1d96172e75c7d9bdd76921
Diffstat (limited to 'ethosu/vela/test/test_tflite_model_semantic.py')
-rw-r--r--ethosu/vela/test/test_tflite_model_semantic.py14
1 files changed, 0 insertions, 14 deletions
diff --git a/ethosu/vela/test/test_tflite_model_semantic.py b/ethosu/vela/test/test_tflite_model_semantic.py
index e290dd2c..115d1cf5 100644
--- a/ethosu/vela/test/test_tflite_model_semantic.py
+++ b/ethosu/vela/test/test_tflite_model_semantic.py
@@ -412,20 +412,6 @@ def test_constraint_matching_either_shapes():
assert not semantic_checker.is_operator_semantic_valid(op)
-def test_constraint_alpha_valid():
- # Alpha can only be negative for int8 and uint8
- op = testutil.create_elemwise_op(Op.LeakyRelu, "op", [2, 2], None, [2, 2], DataType.int16)
- op.attrs["alpha"] = 0
- assert semantic_checker.is_operator_semantic_valid(op)
- op.attrs["alpha"] = -1
- assert not semantic_checker.is_operator_semantic_valid(op)
- op = testutil.create_elemwise_op(Op.LeakyRelu, "op", [2, 2], None, [2, 2], DataType.int8)
- op.attrs["alpha"] = 0
- assert semantic_checker.is_operator_semantic_valid(op)
- op.attrs["alpha"] = -1
- assert semantic_checker.is_operator_semantic_valid(op)
-
-
def test_constraint_hardswish_dtype():
# HardSwish operator dtype should be int8 or uint8, and input dtype must match output
# UINT8