diff options
author | Benjamin Klimczak <benjamin.klimczak@arm.com> | 2023-02-08 16:00:34 +0000 |
---|---|---|
committer | Benjamin Klimczak <benjamin.klimczak@arm.com> | 2023-02-10 13:45:18 +0000 |
commit | fa1fad9332e2912f12a44a1b07716ee434174308 (patch) | |
tree | 246dfdb4ec9c495faaa55d73e061bcb4f8171d98 /src/mlia/target/ethos_u/data_collection.py | |
parent | 7a661257b6adad0c8f53e32b42ced56a1e7d952f (diff) | |
download | mlia-fa1fad9332e2912f12a44a1b07716ee434174308.tar.gz |
MLIA-769 Replace use of 'device' with 'target'
Term 'device' can be ambiguous and is replaced with 'target'.
Change-Id: I5e5108d033a13b98e4c2997713e1c32bce63ae62
Diffstat (limited to 'src/mlia/target/ethos_u/data_collection.py')
-rw-r--r-- | src/mlia/target/ethos_u/data_collection.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/mlia/target/ethos_u/data_collection.py b/src/mlia/target/ethos_u/data_collection.py index 258876d..96fe240 100644 --- a/src/mlia/target/ethos_u/data_collection.py +++ b/src/mlia/target/ethos_u/data_collection.py @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: Copyright 2022, Arm Limited and/or its affiliates. +# SPDX-FileCopyrightText: Copyright 2022-2023, Arm Limited and/or its affiliates. # SPDX-License-Identifier: Apache-2.0 """Data collection module for Ethos-U.""" from __future__ import annotations @@ -31,10 +31,10 @@ logger = logging.getLogger(__name__) class EthosUOperatorCompatibility(ContextAwareDataCollector): """Collect operator compatibility information.""" - def __init__(self, model: Path, device: EthosUConfiguration) -> None: + def __init__(self, model: Path, target: EthosUConfiguration) -> None: """Init operator compatibility data collector.""" self.model = model - self.device = device + self.target = target def collect_data(self) -> Operators: """Collect operator compatibility information.""" @@ -42,7 +42,7 @@ class EthosUOperatorCompatibility(ContextAwareDataCollector): with log_action("Checking operator compatibility ..."): return supported_operators( - Path(tflite_model.model_path), self.device.compiler_options + Path(tflite_model.model_path), self.target.compiler_options ) @classmethod @@ -57,12 +57,12 @@ class EthosUPerformance(ContextAwareDataCollector): def __init__( self, model: Path, - device: EthosUConfiguration, + target: EthosUConfiguration, backends: list[str] | None = None, ) -> None: """Init performance data collector.""" self.model = model - self.device = device + self.target = target self.backends = backends def collect_data(self) -> PerformanceMetrics: @@ -70,7 +70,7 @@ class EthosUPerformance(ContextAwareDataCollector): tflite_model = get_tflite_model(self.model, self.context) estimator = EthosUPerformanceEstimator( self.context, - self.device, + self.target, self.backends, ) @@ -113,13 +113,13 @@ class EthosUOptimizationPerformance(ContextAwareDataCollector): def __init__( self, model: Path, - device: EthosUConfiguration, + target: EthosUConfiguration, optimizations: list[list[dict]], backends: list[str] | None = None, ) -> None: """Init performance optimizations data collector.""" self.model = model - self.device = device + self.target = target self.optimizations = optimizations self.backends = backends @@ -148,7 +148,7 @@ class EthosUOptimizationPerformance(ContextAwareDataCollector): estimator = EthosUPerformanceEstimator( self.context, - self.device, + self.target, self.backends, ) original_metrics, *optimized_metrics = estimate_performance( |