diff options
author | Dmitrii Agibov <dmitrii.agibov@arm.com> | 2022-09-08 14:24:39 +0100 |
---|---|---|
committer | Dmitrii Agibov <dmitrii.agibov@arm.com> | 2022-09-09 17:21:48 +0100 |
commit | f5b293d0927506c2a979a091bf0d07ecc78fa181 (patch) | |
tree | 4de585b7cb6ed34da8237063752270189a730a41 /src/mlia/core/advisor.py | |
parent | cde0c6ee140bd108849bff40467d8f18ffc332ef (diff) | |
download | mlia-f5b293d0927506c2a979a091bf0d07ecc78fa181.tar.gz |
MLIA-386 Simplify typing in the source code
- Enable deferred annotations evaluation
- Use builtin types for type hints whenever possible
- Use | syntax for union types
- Rename mlia.core._typing into mlia.core.typing
Change-Id: I3f6ffc02fa069c589bdd9e8bddbccd504285427a
Diffstat (limited to 'src/mlia/core/advisor.py')
-rw-r--r-- | src/mlia/core/advisor.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/mlia/core/advisor.py b/src/mlia/core/advisor.py index 13689fa..d684241 100644 --- a/src/mlia/core/advisor.py +++ b/src/mlia/core/advisor.py @@ -1,10 +1,11 @@ # SPDX-FileCopyrightText: Copyright 2022, Arm Limited and/or its affiliates. # SPDX-License-Identifier: Apache-2.0 """Inference advisor module.""" +from __future__ import annotations + from abc import abstractmethod from pathlib import Path from typing import cast -from typing import List from mlia.core.advice_generation import AdviceProducer from mlia.core.common import NamedEntity @@ -44,19 +45,19 @@ class DefaultInferenceAdvisor(InferenceAdvisor, ParameterResolverMixin): ) @abstractmethod - def get_collectors(self, context: Context) -> List[DataCollector]: + def get_collectors(self, context: Context) -> list[DataCollector]: """Return list of the data collectors.""" @abstractmethod - def get_analyzers(self, context: Context) -> List[DataAnalyzer]: + def get_analyzers(self, context: Context) -> list[DataAnalyzer]: """Return list of the data analyzers.""" @abstractmethod - def get_producers(self, context: Context) -> List[AdviceProducer]: + def get_producers(self, context: Context) -> list[AdviceProducer]: """Return list of the advice producers.""" @abstractmethod - def get_events(self, context: Context) -> List[Event]: + def get_events(self, context: Context) -> list[Event]: """Return list of the startup events.""" def get_string_parameter(self, context: Context, param: str) -> str: |