Source code for afe.tvm_converter.parameters

#########################################################
# Copyright (C) 2023 SiMa Technologies, Inc.
#
# This material is SiMa proprietary and confidential.
#
# This material may not be copied or distributed without
# the express prior written permission of SiMa.
#
# All rights reserved.
#########################################################
# Code owner: Christopher Rodrigues
#########################################################
"""
Global parameters to the TVM converter.  This holds data
that is passed to the converter and is globally available
during the TVM converter.
"""
from dataclasses import dataclass

from afe.apis.defines import gen1_target
from afe.ir.defines import RequantizationMode
from sima_utils.common import Platform


@dataclass(frozen=True)
[docs] class TVMConverterParams: """ Parameters to an invocation of the TVM converter. These parameters control how to convert a Relay IR module to an AwesomeNet. :param requantization_mode: Requantization mode to use when translating quantized operators. :param is_quantized: Whether the module is already quantized. If true, then the translation will not prepare for the SiMa IR quantization pass to run afterward. :param target: A target platform that a model is compiled for. """
[docs] requantization_mode: RequantizationMode = RequantizationMode.sima
[docs] is_quantized: bool = False
[docs] target: Platform = gen1_target