afe.ir.sima_ir ============== .. py:module:: afe.ir.sima_ir Attributes ---------- .. autoapisummary:: afe.ir.sima_ir.SiMaIRTensorTypes afe.ir.sima_ir.SiMaIRInputTypes afe.ir.sima_ir.NODE_DICT_OPERATORS afe.ir.sima_ir.NODE_DICT_SPECIAL afe.ir.sima_ir.NODE_DICT afe.ir.sima_ir.ATTRS_NAME_DICT Classes ------- .. autoapisummary:: afe.ir.sima_ir.SiMaIRMetadata afe.ir.sima_ir.SiMaIR afe.ir.sima_ir.SiMaIRParamsDict Module Contents --------------- .. py:data:: SiMaIRTensorTypes .. py:data:: SiMaIRInputTypes .. py:class:: SiMaIRMetadata(relay_ir_name: str) dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object's (key, value) pairs dict(iterable) -> new dictionary initialized as if via: d = {} for k, v in iterable: d[k] = v dict(**kwargs) -> new dictionary initialized with the name=value pairs in the keyword argument list. For example: dict(one=1, two=2) .. py:class:: SiMaIR :param operation: Contains the node's functions :param _attrs: Floating-point operator attributes. If the operator is quantized, it should be None. :param calib_attrs: Calibration attributes :param _quant_attrs: Quantized operator attributes. If the operator is not quantized, it should be None. :param quant_config: Parameters that influence how the operator is quantized. This field is immutable. :param backend: If this node is assigned to a backend by itself (not counting being part of a subgraph assigned to a backend), this is the assigned backend. Otherwise, this is Backend.NONE. .. py:attribute:: operation :type: afe.ir.operations.AwesomeOperation .. py:attribute:: calib_attrs :type: afe.ir.attributes.AwesomeCalibAttrs .. py:attribute:: quant_config :type: afe.core.configs.QuantizationConfigs .. py:attribute:: backend :type: afe.backends.Backend .. py:property:: attrs :type: Optional[afe.ir.attributes.AwesomeAttributes] .. py:method:: get_attrs() -> afe.ir.attributes.AwesomeAttributes | afe.ir.attributes.AwesomeQuantAttrBase .. py:property:: quant_attrs :type: Optional[afe.ir.attributes.AwesomeQuantAttrBase] .. py:method:: should_bypass_input_to_output() Whether the SiMaIR bypasses the input to the output. .. py:method:: get_type() -> afe.ir.tensor_type.NodeType Get the type of this node. .. py:method:: run(inputs: SiMaIRInputTypes, config: afe.core.configs.RunConfigs) .. py:method:: calibrate(inputs: SiMaIRInputTypes, config: afe.core.configs.RunConfigs) .. py:method:: quantize(inputs: Dict[afe.ir.defines.InputName, afe.ir.operations.QuantizationTensorData], placeholder_value: Optional[afe.ir.operations.QuantizationTensorData], quantize_attributes: bool, error_reporter: Optional[afe.ir.defines.NodeReporter] = None) -> Tuple[afe.ir.operations.QuantizationTensorData, afe.ir.defines.InputsQuantCast] Select quantization scales of input and output tensors, and quantize this operation. The input and output attributes are planned to be removed, and they should not be used in new code. :param inputs: Properties of the inputs. It has quantization scales of the input tensors and attributes of the nodes that calculate the inputs. :param placeholder_value: If the node being quantized is a placeholder node, the properties of the placeholder's input data. None otherwise. :param quantize_attributes: If True, the operation will be quantized. If False, the operation will not be quantized. Either way, quantization scales will be selected. :param error_reporter: Node reporter of the node to be quantized. :return: Properties of the node's output and casts that should be applied to the node's input. It has quantization scales of the output and attributes of this node. .. py:method:: run_quant(inputs: SiMaIRInputTypes, config: afe.core.configs.RunConfigs) .. py:method:: set_batch_size(batch_size: int) Modifies SiMaIR's internal parameters to accommodate for a given batch size. :param batch_size: Integer value representing the batch size of the inputs to the AwesomeNet. .. py:class:: SiMaIRParamsDict .. py:attribute:: attrs :type: Type[afe.ir.attributes.AwesomeAttributes] .. py:attribute:: quant_attrs :type: Type[afe.ir.attributes.AwesomeQuantAttrBase] .. py:attribute:: operation :type: afe.ir.operations.AwesomeOperation .. py:data:: NODE_DICT_OPERATORS :type: Dict[str, SiMaIRParamsDict] .. py:data:: NODE_DICT_SPECIAL :type: Dict[str, SiMaIRParamsDict] .. py:data:: NODE_DICT :type: Dict[str, SiMaIRParamsDict] .. py:data:: ATTRS_NAME_DICT :type: Dict[str, Type[afe.ir.attributes.AwesomeAttributes]]