diff options
author | Dmitrii Agibov <dmitrii.agibov@arm.com> | 2022-11-18 17:21:09 +0000 |
---|---|---|
committer | Dmitrii Agibov <dmitrii.agibov@arm.com> | 2022-11-29 14:44:13 +0000 |
commit | 6a88ee5315b4ce5b023370c1e55e48bf9f2b6f67 (patch) | |
tree | 88edabf90228724f4fe2944b0ab23859d824a880 /tests/test_target_cortex_a_advisor.py | |
parent | a34163c9d9a5cc0416bcaea2ebf8383bda9d505c (diff) | |
download | mlia-6a88ee5315b4ce5b023370c1e55e48bf9f2b6f67.tar.gz |
Rename modules
- Rename module "mlia.devices" into "mlia.target"
- Rename module "mlia.target.ethosu" into "mlia.target.ethos_u"
- Rename module "mlia.target.cortexa" into "mlia.target.cortex_a"
- Rename and update tests
Change-Id: I6dca7c8646d881f739fb6b5914d1cc7e45e63dc2
Diffstat (limited to 'tests/test_target_cortex_a_advisor.py')
-rw-r--r-- | tests/test_target_cortex_a_advisor.py | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/test_target_cortex_a_advisor.py b/tests/test_target_cortex_a_advisor.py new file mode 100644 index 0000000..1788a6d --- /dev/null +++ b/tests/test_target_cortex_a_advisor.py @@ -0,0 +1,34 @@ +# SPDX-FileCopyrightText: Copyright 2022, Arm Limited and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 +"""Tests for Cortex-A MLIA module.""" +from pathlib import Path + +from mlia.core.context import ExecutionContext +from mlia.core.workflow import DefaultWorkflowExecutor +from mlia.target.cortex_a.advisor import configure_and_get_cortexa_advisor +from mlia.target.cortex_a.advisor import CortexAInferenceAdvisor + + +def test_advisor_metadata() -> None: + """Test advisor metadata.""" + assert CortexAInferenceAdvisor.name() == "cortex_a_inference_advisor" + + +def test_configure_and_get_cortex_a_advisor(test_tflite_model: Path) -> None: + """Test Cortex-A advisor configuration.""" + ctx = ExecutionContext() + + advisor = configure_and_get_cortexa_advisor(ctx, "cortex-a", test_tflite_model) + workflow = advisor.configure(ctx) + + assert isinstance(advisor, CortexAInferenceAdvisor) + + assert ctx.event_handlers is not None + assert ctx.config_parameters == { + "cortex_a_inference_advisor": { + "model": str(test_tflite_model), + "target_profile": "cortex-a", + } + } + + assert isinstance(workflow, DefaultWorkflowExecutor) |