From fa1fad9332e2912f12a44a1b07716ee434174308 Mon Sep 17 00:00:00 2001 From: Benjamin Klimczak Date: Wed, 8 Feb 2023 16:00:34 +0000 Subject: MLIA-769 Replace use of 'device' with 'target' Term 'device' can be ambiguous and is replaced with 'target'. Change-Id: I5e5108d033a13b98e4c2997713e1c32bce63ae62 --- tests/test_backend_vela_performance.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'tests/test_backend_vela_performance.py') diff --git a/tests/test_backend_vela_performance.py b/tests/test_backend_vela_performance.py index 569de61..68b96ab 100644 --- a/tests/test_backend_vela_performance.py +++ b/tests/test_backend_vela_performance.py @@ -14,8 +14,8 @@ from mlia.target.ethos_u.config import EthosUConfiguration def test_estimate_performance(test_tflite_model: Path) -> None: """Test getting performance estimations.""" - device = EthosUConfiguration.load_profile("ethos-u55-256") - perf_metrics = estimate_performance(test_tflite_model, device.compiler_options) + target = EthosUConfiguration.load_profile("ethos-u55-256") + perf_metrics = estimate_performance(test_tflite_model, target.compiler_options) assert isinstance(perf_metrics, PerformanceMetrics) @@ -24,16 +24,16 @@ def test_estimate_performance_already_optimized( tmp_path: Path, test_tflite_model: Path ) -> None: """Test that performance estimation should fail for already optimized model.""" - device = EthosUConfiguration.load_profile("ethos-u55-256") + target = EthosUConfiguration.load_profile("ethos-u55-256") optimized_model_path = tmp_path / "optimized_model.tflite" - optimize_model(test_tflite_model, device.compiler_options, optimized_model_path) + optimize_model(test_tflite_model, target.compiler_options, optimized_model_path) with pytest.raises( Exception, match="Unable to estimate performance for the given optimized model" ): - estimate_performance(optimized_model_path, device.compiler_options) + estimate_performance(optimized_model_path, target.compiler_options) def test_read_invalid_model(test_tflite_invalid_model: Path) -> None: @@ -41,8 +41,8 @@ def test_read_invalid_model(test_tflite_invalid_model: Path) -> None: with pytest.raises( Exception, match=f"Unable to read model {test_tflite_invalid_model}" ): - device = EthosUConfiguration.load_profile("ethos-u55-256") - estimate_performance(test_tflite_invalid_model, device.compiler_options) + target = EthosUConfiguration.load_profile("ethos-u55-256") + estimate_performance(test_tflite_invalid_model, target.compiler_options) def test_compile_invalid_model( @@ -58,7 +58,7 @@ def test_compile_invalid_model( with pytest.raises( Exception, match="Model could not be optimized with Vela compiler" ): - device = EthosUConfiguration.load_profile("ethos-u55-256") - optimize_model(test_tflite_model, device.compiler_options, model_path) + target = EthosUConfiguration.load_profile("ethos-u55-256") + optimize_model(test_tflite_model, target.compiler_options, model_path) assert not model_path.exists() -- cgit v1.2.1