blob: 868d0c7e25671bf767329f8516296dfbcbe5a408 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
# SPDX-FileCopyrightText: Copyright 2022, Arm Limited and/or its affiliates.
# SPDX-License-Identifier: Apache-2.0
"""Inference advisor module."""
from abc import abstractmethod
from mlia.core.common import NamedEntity
from mlia.core.context import Context
from mlia.core.workflow import WorkflowExecutor
class InferenceAdvisor(NamedEntity):
"""Base class for inference advisors."""
@abstractmethod
def configure(self, context: Context) -> WorkflowExecutor:
"""Configure advisor execution."""
def run(self, context: Context) -> None:
"""Run inference advisor."""
executor = self.configure(context)
executor.run()
|