Skip to main content

afe.apis.loaded_net

Source: afe/apis/loaded_net.py

Back to index

Imports

Constants

  • GroundTruth (line 54) [default/value TypeVar('GroundTruth')]

Classes

  • LoadedNet (line 252)
    • execute(inputs: InputValues, *, log_level: int = logging.NOTSET) -> list[np.ndarray] (line 287) Decorators: _sanitize_exceptions(ExceptionFuncType.LOADED_NET_EXECUTE).

      Parameters:

      • inputs: type InputValues
      • log_level: type int, default logging.NOTSET

      Returns: list[np.ndarray]

    • quantize(calibration_data: Iterable[InputValues] | None, quantization_config: QuantizationParams, *, automatic_layout_conversion: bool = False, arm_only: bool = False, simulated_arm: bool = False, model_name: str | None = None, any_shape_on_mla: bool = False, log_level: int = logging.NOTSET) -> Model (line 332) Decorators: _sanitize_exceptions(ExceptionFuncType.LOADED_NET_QUANTIZE).

      Parameters:

      • calibration_data: type Iterable[InputValues] | None
      • quantization_config: type QuantizationParams
      • automatic_layout_conversion: type bool, default False
      • arm_only: type bool, default False
      • simulated_arm: type bool, default False
      • model_name: type str | None, default None
      • any_shape_on_mla: type bool, default False
      • log_level: type int, default logging.NOTSET

      Returns: Model

    • quantize_with_accuracy_feedback(calibration_data: Iterable[InputValues], evaluation_data: Iterable[tuple[InputValues, GroundTruth]], quantization_config: QuantizationParams, *, accuracy_score: Statistic[tuple[list[np.ndarray], GroundTruth], float], target_accuracy: float, automatic_layout_conversion: bool = False, max_optimization_steps: int | None = None, model_name: str | None = None, any_shape_on_mla: bool = False, log_level: int = logging.NOTSET) -> Model (line 390) Decorators: _sanitize_exceptions(ExceptionFuncType.LOADED_NET_QUANTIZE).

      Parameters:

      • calibration_data: type Iterable[InputValues]
      • evaluation_data: type Iterable[tuple[InputValues, GroundTruth]]
      • quantization_config: type QuantizationParams
      • accuracy_score: type Statistic[tuple[list[np.ndarray], GroundTruth], float]
      • target_accuracy: type float
      • automatic_layout_conversion: type bool, default False
      • max_optimization_steps: type int | None, default None
      • model_name: type str | None, default None
      • any_shape_on_mla: type bool, default False
      • log_level: type int, default logging.NOTSET

      Returns: Model

    • convert_to_sima_quantization(*, requantization_mode: RequantizationMode = RequantizationMode.sima, model_name: str | None = None, any_shape_on_mla: bool = False, log_level: int = logging.NOTSET) -> Model (line 448) Decorators: _sanitize_exceptions(ExceptionFuncType.LOADED_NET_CONVERT).

      Parameters:

      • requantization_mode: type RequantizationMode, default RequantizationMode.sima
      • model_name: type str | None, default None
      • any_shape_on_mla: type bool, default False
      • log_level: type int, default logging.NOTSET

      Returns: Model

Functions

  • load_model(params: ImporterParams, *, target: Platform = gen1_target, custom_param_data: CustomPlatformParams | None = None, log_level: int = logging.NOTSET) -> LoadedNet (line 487) Decorators: _sanitize_exceptions(ExceptionFuncType.LOADED_NET_LOAD).

    Parameters:

    • params: type ImporterParams
    • target: type Platform, default gen1_target
    • custom_param_data: type CustomPlatformParams | None, default None
    • log_level: type int, default logging.NOTSET

    Returns: LoadedNet