aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
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,