aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBenjamin Klimczak <benjamin.klimczak@arm.com>2023-08-14 14:17:45 +0100
committerBenjamin Klimczak <benjamin.klimczak@arm.com>2023-08-21 13:10:05 +0100
commit87647b7bf1ee89b20aa87768ec8c82f329082db0 (patch)
tree4cdea8590e8f82bb1ba1322033e00c37b5ee178c /tests
parenta202a1a26c74fef898fb302c621ccfc258fa688c (diff)
downloadmlia-87647b7bf1ee89b20aa87768ec8c82f329082db0.tar.gz
MLIA-881 Update compatible operators for Cortex-A
Update the compatibility information of the backend for ArmNN TensorFlow Lite Delegate (classic) to version 23.05. Change-Id: I84693842d1a883f7083a6faf7d5ddcd5ecc34e5d Signed-off-by: Benjamin Klimczak <benjamin.klimczak@arm.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/test_backend_armnn_tflite_delegate_compat.py21
-rw-r--r--tests/test_target_cortex_a_data_analysis.py2
-rw-r--r--tests/test_target_cortex_a_operators.py17
3 files changed, 22 insertions, 18 deletions
diff --git a/tests/test_backend_armnn_tflite_delegate_compat.py b/tests/test_backend_armnn_tflite_delegate_compat.py
new file mode 100644
index 0000000..658e707
--- /dev/null
+++ b/tests/test_backend_armnn_tflite_delegate_compat.py
@@ -0,0 +1,21 @@
+# SPDX-FileCopyrightText: Copyright 2022-2023, Arm Limited and/or its affiliates.
+# SPDX-License-Identifier: Apache-2.0
+"""Tests for ArmNN TensorFlow Lite Delegate backend."""
+from typing import cast
+
+from mlia.backend.armnn_tflite_delegate import compat
+from mlia.nn.tensorflow.tflite_graph import TFL_OP
+
+
+def test_compat_data() -> None:
+ """Make sure all data contains the necessary items."""
+ builtin_tfl_ops = {op.name for op in TFL_OP}
+ assert "backend" in compat.ARMNN_TFLITE_DELEGATE
+ assert "ops" in compat.ARMNN_TFLITE_DELEGATE
+
+ ops = cast(dict, compat.ARMNN_TFLITE_DELEGATE["ops"])
+ for data in ops.values():
+ assert "builtin_ops" in data
+ for comp in data["builtin_ops"]:
+ assert comp in builtin_tfl_ops
+ assert "custom_ops" in data
diff --git a/tests/test_target_cortex_a_data_analysis.py b/tests/test_target_cortex_a_data_analysis.py
index e033ef9..73d1126 100644
--- a/tests/test_target_cortex_a_data_analysis.py
+++ b/tests/test_target_cortex_a_data_analysis.py
@@ -47,7 +47,7 @@ BACKEND_INFO = f"{ARMNN_TFLITE_DELEGATE['backend']} {VERSION}"
Operator(
"CUSTOM",
"somewhere else",
- activation_func=TFL_ACTIVATION_FUNCTION.SIGN_BIT,
+ activation_func=TFL_ACTIVATION_FUNCTION.RELU6,
custom_name="MaxPool3D",
),
],
diff --git a/tests/test_target_cortex_a_operators.py b/tests/test_target_cortex_a_operators.py
index 8bc48e6..56d6c7b 100644
--- a/tests/test_target_cortex_a_operators.py
+++ b/tests/test_target_cortex_a_operators.py
@@ -2,33 +2,16 @@
# SPDX-License-Identifier: Apache-2.0
"""Tests for Cortex-A operator compatibility."""
from pathlib import Path
-from typing import cast
import pytest
import tensorflow as tf
-from mlia.backend.armnn_tflite_delegate import compat
-from mlia.nn.tensorflow.tflite_graph import TFL_OP
from mlia.nn.tensorflow.utils import convert_to_tflite
from mlia.target.cortex_a.config import CortexAConfiguration
from mlia.target.cortex_a.operators import CortexACompatibilityInfo
from mlia.target.cortex_a.operators import get_cortex_a_compatibility_info
-def test_compat_data() -> None:
- """Make sure all data contains the necessary items."""
- builtin_tfl_ops = {op.name for op in TFL_OP}
- assert "backend" in compat.ARMNN_TFLITE_DELEGATE
- assert "ops" in compat.ARMNN_TFLITE_DELEGATE
-
- ops = cast(dict, compat.ARMNN_TFLITE_DELEGATE["ops"])
- for data in ops.values():
- assert "builtin_ops" in data
- for comp in data["builtin_ops"]:
- assert comp in builtin_tfl_ops
- assert "custom_ops" in data
-
-
def check_get_cortex_a_compatibility_info(
model_path: Path,
expected_success: bool,