afe.ir.operations ================= .. py:module:: afe.ir.operations Attributes ---------- .. autoapisummary:: afe.ir.operations.T afe.ir.operations.AWESOME_ATTRS afe.ir.operations.QUANT_ATTRS afe.ir.operations.QuantizationTensorData Classes ------- .. autoapisummary:: afe.ir.operations.ObserverBehavior afe.ir.operations.PropagateObserver afe.ir.operations.PerTensorPropagateObserver afe.ir.operations.UsesObserver afe.ir.operations.NoObserver afe.ir.operations.AwesomeOperation afe.ir.operations.PlaceholderOp afe.ir.operations.ConstantOp afe.ir.operations.MaxPool2DOp afe.ir.operations.MaxPool3DOp afe.ir.operations.AvgPool2DOp afe.ir.operations.AvgPool3DOp afe.ir.operations.VarianceOp afe.ir.operations.MultiplyOp afe.ir.operations.PadOp afe.ir.operations.MeanOp afe.ir.operations.ArgMaxOp afe.ir.operations.SoftmaxOp afe.ir.operations.LRNOp afe.ir.operations.ExtmOp afe.ir.operations.SumOp afe.ir.operations.ProdOp afe.ir.operations.SubtractOp afe.ir.operations.PowerOp afe.ir.operations.MaximumOp afe.ir.operations.MinimumOp afe.ir.operations.FullOp afe.ir.operations.TileOp afe.ir.operations.PReluOp afe.ir.operations.BroadcastToOp afe.ir.operations.UDFOp afe.ir.operations.SqrtOp afe.ir.operations.RsqrtOp afe.ir.operations.TanhOp afe.ir.operations.SigmoidOp afe.ir.operations.LogOp afe.ir.operations.Log2Op afe.ir.operations.Log10Op afe.ir.operations.ReciprocalOp afe.ir.operations.EluOp afe.ir.operations.SoftplusOp afe.ir.operations.ErfOp afe.ir.operations.GeluOp afe.ir.operations.DivideOp afe.ir.operations.ExpOp afe.ir.operations.SwishOp afe.ir.operations.QuickGeluOp afe.ir.operations.HardSwishOp afe.ir.operations.UpsamplingOp afe.ir.operations.ImageResize2DOp afe.ir.operations.GridSampleOp afe.ir.operations.TupleOp afe.ir.operations.TupleGetItemOp afe.ir.operations.SqueezeOp afe.ir.operations.ConcatenateOp afe.ir.operations.TransposeOp afe.ir.operations.DepthToSpaceOp afe.ir.operations.ReshapeOp afe.ir.operations.ExpandDimsOp afe.ir.operations.SplitOp afe.ir.operations.TakeOp afe.ir.operations.StridedSliceOp afe.ir.operations.BatchFlattenOp afe.ir.operations.LayoutTransformOp afe.ir.operations.TessellationTransformOp afe.ir.operations.DetessellationTransformOp afe.ir.operations.PackTransformOp afe.ir.operations.UnpackTransformOp afe.ir.operations.NormalizationTransformOp afe.ir.operations.QuantizationTransformOp afe.ir.operations.DequantizationTransformOp afe.ir.operations.ResizeTransformOp afe.ir.operations.ChromaUpsampleTransformOp afe.ir.operations.YuvRgbConversionTransformOp afe.ir.operations.BgrRgbConversionTransformOp afe.ir.operations.SigmoidTransformOp afe.ir.operations.NmsMaxpoolTransformOp afe.ir.operations.CastOp afe.ir.operations.AddActivationOp afe.ir.operations.ConstantMultiplyAddOp afe.ir.operations.ConvolutionObserverBehavior afe.ir.operations.ConvAddActivationOp afe.ir.operations.TupleConcatenateOp afe.ir.operations.ExternalOp afe.ir.operations.QNNQuantizeOp afe.ir.operations.RequantizeOp afe.ir.operations.QNNDequantizeOp afe.ir.operations.QNNMulOp afe.ir.operations.CustomOp afe.ir.operations.LeakyReluCompositeOp afe.ir.operations.ReluOp afe.ir.operations.ClipOp afe.ir.operations.BatchMatmulOp afe.ir.operations.UnaryBatchMatmulOp afe.ir.operations.LayerNormOp afe.ir.operations.InstanceNormOp afe.ir.operations.RMSNormOp afe.ir.operations.SliceConcatOp afe.ir.operations.HardSigmoidOp Functions --------- .. autoapisummary:: afe.ir.operations.make_quantized_pool_attrs afe.ir.operations.get_reduction_op_output_shape afe.ir.operations.node_type_for_dimension_reduction_operators afe.ir.operations.has_any_int8_input afe.ir.operations.get_squeeze_out_shape afe.ir.operations.get_expand_dims_out_shape afe.ir.operations.get_batch_flatten_out_shape afe.ir.operations.get_pack_input_types afe.ir.operations.make_quantization_cast afe.ir.operations.make_quantization_casts Module Contents --------------- .. py:data:: T .. py:data:: AWESOME_ATTRS .. py:data:: QUANT_ATTRS .. py:data:: QuantizationTensorData TODO: * Merge the quantization in single node and composite node. Ex: Use Conv2DOp.quantize in ConvAddActivationOp * Merge quantization, run_quant for Conv2D and Conv2DTranspose * Create check_attrs function to check attrs and quant_attrs .. py:function:: make_quantized_pool_attrs(attrs: afe.ir.attributes.PoolAttrs, *, pad_value: int, input_int16: bool, requant: afe.ir.attributes.Optional[afe.ir.attributes.BaseRequantization] = None) -> afe.ir.attributes.PoolQuantAttrs Construct a PoolQuantAttrs, using values from a PoolAttrs and additional values that were computed during quantization. .. py:function:: get_reduction_op_output_shape(attrs: afe.ir.attributes.Union[afe.ir.attributes.ReduceAttrs, afe.ir.attributes.ProdAttrs, afe.ir.attributes.ExtmAttrs, afe.ir.attributes.ArgMaxAttrs]) Get the output shape for the dimension-reduction operators (SumOp, MeanOp, ProdOp, ExtmOp & ArgMaxOp) using attributes from their AwesomeAttributes class. :param attrs: AwesomeAttributes class :return: Output shape .. py:function:: node_type_for_dimension_reduction_operators(attrs: afe.ir.attributes.Union[afe.ir.attributes.ReduceAttrs, afe.ir.attributes.ProdAttrs, afe.ir.attributes.ExtmAttrs, afe.ir.attributes.ArgMaxAttrs], input_dtype: afe.ir.attributes.Union[afe.ir.attributes.np.dtype, Type[afe.ir.attributes.np.number]], output_dtype: afe.ir.attributes.Union[afe.ir.attributes.np.dtype, Type[afe.ir.attributes.np.number]]) Get NodeType for the dimension-reduction opreators (SumOp, MeanOp, ProdOp, ExtmOp & ArgMaxOp) :param attrs: AwesomeAttributes class :param dtype: Data type :return: NodeType .. py:function:: has_any_int8_input(quantizer_interface: afe.ir.quantization_interface.OpQuantInterface, input_names: afe.ir.attributes.Sequence[afe.ir.defines.InputName]) -> bool Return True if any of the inputs identified by input_names was quantized with int8 precision. .. py:function:: get_squeeze_out_shape(axis: list[int], input_shape: tuple[int, Ellipsis]) -> tuple[int, Ellipsis] Get SqueezeOp output shape. :param axis: Set of axes to remove :param input_shape: Shape of input tensor :returns: Output shape. .. py:function:: get_expand_dims_out_shape(attrs: afe.ir.attributes.ExpandDimsAttrs) -> afe.ir.attributes.Tuple[int, Ellipsis] Get ExpandDimsOp output shape. :param attrs: ExpanDims attributes class. :return: Output shape. .. py:function:: get_batch_flatten_out_shape(attrs: afe.ir.attributes.BatchFlattenAttrs) -> tuple[int, Ellipsis] Get Batch Flatten output shape. :param attrs: BatchFlattenAttrs attributes class. :returns: Output shape. :rtype: Tuple[int, ...] .. py:function:: get_pack_input_types(input_types: afe.ir.attributes.List[afe.ir.tensor_type.TensorType]) -> afe.ir.attributes.List[afe.ir.tensor_type.TensorType] Get pack operator input types. If input tensor has 4D shape it will be reshaped to 2D MLA buffer shape. .. py:function:: make_quantization_cast(provided_type: afe.ir.defines.DataValue[afe.ir.attributes.QuantResultTensorType], wanted_type: afe.ir.defines.DataValue[afe.ir.attributes.QuantResultTensorType]) -> afe.ir.defines.QuantizationCast Make a quantization cast for one value. :param provided_type: Type and quantization of the value :param wanted_type: Type and quantization that it should be cast to :return: Cast .. py:function:: make_quantization_casts(provided_input_types: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.defines.DataValue[afe.ir.attributes.QuantResultTensorType]], wanted_input_types: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.defines.DataValue[afe.ir.attributes.QuantResultTensorType]]) -> afe.ir.defines.InputsQuantCast Create casts for a quantized node's input types by comparing the input data type with the type that the node requires. :param provided_input_types: Type and quantization of a node's inputs, after quantization :param wanted_input_types: Type and quantization that the quantized node requires :return: Casts for the node .. py:class:: ObserverBehavior Abstract base class of observer behavior associated with an operator. .. py:method:: create_observers(calib_config: afe.core.configs.CalibrationConfigs, quant_config: afe.core.configs.QuantizationConfigs, calib_attrs: afe.ir.attributes.AwesomeCalibAttrs, attrs: AWESOME_ATTRS, reporter: afe.ir.defines.NodeReporter) -> tuple[afe.ir.attributes.NodeObserver | None, dict[str, afe.ir.attributes.NodeObserver]] :abstractmethod: Create new observers for a node as needed for calibration. For operators that do not use observers, return (None, {}). The caller may save the returned observers in calib_attrs for use in calibration and quantization. :param calib_config: Configuration parameters for calibration :param quant_config: Configuration parameters for quantization :param calib_attrs: The node's calibration attributes :param attrs: The node's attributes :param reporter: How to process errors that occur in the observers :returns: Observer for the node's output and observers for intermediate values .. py:method:: get_observed_distribution(calib_attrs: afe.ir.attributes.AwesomeCalibAttrs, inputs: dict[afe.ir.defines.InputName, QuantizationTensorData]) -> tuple[afe.ir.attributes.Optional[afe.ir.attributes.ObservedDistribution], dict[str, afe.ir.attributes.ObservedDistribution]] :abstractmethod: Get observed distribution and intermediate observed distributions. The observed distribution can be None for operators that do not use observers or if calibration was not performed. :param calib_attrs: Calibration attributes. :param inputs: Properties of the inputs. It has quantization scales of the input tensors and attributes of the nodes that calculate the inputs. :returns: Tuple of observed distribution and dictionary of intermediate observed distributions. .. py:class:: PropagateObserver Reuse the observer from the node's input to describe the statistics of the node's output. This is for operators that have one input and one output where the input value distribution can be used as an approximation of the output value distribution. .. py:method:: create_observers(calib_config: afe.core.configs.CalibrationConfigs, quant_config: afe.core.configs.QuantizationConfigs, calib_attrs: afe.ir.attributes.AwesomeCalibAttrs, attrs: AWESOME_ATTRS, reporter: afe.ir.defines.NodeReporter) -> tuple[afe.ir.attributes.NodeObserver | None, dict[str, afe.ir.attributes.NodeObserver]] Create new observers for a node as needed for calibration. For operators that do not use observers, return (None, {}). The caller may save the returned observers in calib_attrs for use in calibration and quantization. :param calib_config: Configuration parameters for calibration :param quant_config: Configuration parameters for quantization :param calib_attrs: The node's calibration attributes :param attrs: The node's attributes :param reporter: How to process errors that occur in the observers :returns: Observer for the node's output and observers for intermediate values .. py:method:: get_observed_distribution(calib_attrs: afe.ir.attributes.AwesomeCalibAttrs, inputs: dict[afe.ir.defines.InputName, QuantizationTensorData]) -> tuple[afe.ir.attributes.ObservedDistribution | None, dict[str, afe.ir.attributes.ObservedDistribution]] Get observed distribution and intermediate observed distributions. The observed distribution can be None for operators that do not use observers or if calibration was not performed. :param calib_attrs: Calibration attributes. :param inputs: Properties of the inputs. It has quantization scales of the input tensors and attributes of the nodes that calculate the inputs. :returns: Tuple of observed distribution and dictionary of intermediate observed distributions. .. py:class:: PerTensorPropagateObserver Reuse the observer from the node's input to describe the statistics of the node's output, and require the observer to have per-tensor statistics only. This is for operators that have one input and one output where the input value distribution can be used as an approximation of the output value distribution. By restricting to per-tensor statistics, this observer can be used even if the operator does not preserve the same channels as its input. .. py:method:: create_observers(calib_config: afe.core.configs.CalibrationConfigs, quant_config: afe.core.configs.QuantizationConfigs, calib_attrs: afe.ir.attributes.AwesomeCalibAttrs, attrs: AWESOME_ATTRS, reporter: afe.ir.defines.NodeReporter) -> tuple[afe.ir.attributes.NodeObserver | None, dict[str, afe.ir.attributes.NodeObserver]] Create new observers for a node as needed for calibration. For operators that do not use observers, return (None, {}). The caller may save the returned observers in calib_attrs for use in calibration and quantization. :param calib_config: Configuration parameters for calibration :param quant_config: Configuration parameters for quantization :param calib_attrs: The node's calibration attributes :param attrs: The node's attributes :param reporter: How to process errors that occur in the observers :returns: Observer for the node's output and observers for intermediate values .. py:method:: get_observed_distribution(calib_attrs: afe.ir.attributes.AwesomeCalibAttrs, inputs: dict[afe.ir.defines.InputName, QuantizationTensorData]) -> tuple[afe.ir.attributes.ObservedDistribution | None, dict[str, afe.ir.attributes.ObservedDistribution]] Get observed distribution and intermediate observed distributions. The observed distribution can be None for operators that do not use observers or if calibration was not performed. :param calib_attrs: Calibration attributes. :param inputs: Properties of the inputs. It has quantization scales of the input tensors and attributes of the nodes that calculate the inputs. :returns: Tuple of observed distribution and dictionary of intermediate observed distributions. .. py:class:: UsesObserver(intermediate_names: afe.ir.attributes.Sequence[str] = ()) Use an observer for the node's output and some observers for intermediate values. This is for operators that compute an output tensor. .. py:method:: create_observers(calib_config: afe.core.configs.CalibrationConfigs, quant_config: afe.core.configs.QuantizationConfigs, calib_attrs: afe.ir.attributes.AwesomeCalibAttrs, attrs: AWESOME_ATTRS, reporter: afe.ir.defines.NodeReporter) -> tuple[afe.ir.attributes.NodeObserver | None, dict[str, afe.ir.attributes.NodeObserver]] Create new observers for a node as needed for calibration. For operators that do not use observers, return (None, {}). The caller may save the returned observers in calib_attrs for use in calibration and quantization. :param calib_config: Configuration parameters for calibration :param quant_config: Configuration parameters for quantization :param calib_attrs: The node's calibration attributes :param attrs: The node's attributes :param reporter: How to process errors that occur in the observers :returns: Observer for the node's output and observers for intermediate values .. py:method:: get_observed_distribution(calib_attrs: afe.ir.attributes.AwesomeCalibAttrs, inputs: dict[afe.ir.defines.InputName, QuantizationTensorData]) -> tuple[afe.ir.attributes.ObservedDistribution | None, dict[str, afe.ir.attributes.ObservedDistribution]] Get observed distribution and intermediate observed distributions. The observed distribution can be None for operators that do not use observers or if calibration was not performed. :param calib_attrs: Calibration attributes. :param inputs: Properties of the inputs. It has quantization scales of the input tensors and attributes of the nodes that calculate the inputs. :returns: Tuple of observed distribution and dictionary of intermediate observed distributions. .. py:class:: NoObserver Do not use observers. This is for operators that do not support integer quantization and operators that do not always output a floating-point tensor. .. py:method:: create_observers(calib_config: afe.core.configs.CalibrationConfigs, quant_config: afe.core.configs.QuantizationConfigs, calib_attrs: afe.ir.attributes.AwesomeCalibAttrs, attrs: AWESOME_ATTRS, reporter: afe.ir.defines.NodeReporter) -> tuple[afe.ir.attributes.NodeObserver | None, dict[str, afe.ir.attributes.NodeObserver]] Create new observers for a node as needed for calibration. For operators that do not use observers, return (None, {}). The caller may save the returned observers in calib_attrs for use in calibration and quantization. :param calib_config: Configuration parameters for calibration :param quant_config: Configuration parameters for quantization :param calib_attrs: The node's calibration attributes :param attrs: The node's attributes :param reporter: How to process errors that occur in the observers :returns: Observer for the node's output and observers for intermediate values .. py:method:: get_observed_distribution(calib_attrs: afe.ir.attributes.AwesomeCalibAttrs, inputs: dict[afe.ir.defines.InputName, QuantizationTensorData]) -> tuple[afe.ir.attributes.Optional[afe.ir.attributes.ObservedDistribution], dict[str, afe.ir.attributes.ObservedDistribution]] Get observed distribution and intermediate observed distributions. The observed distribution can be None for operators that do not use observers or if calibration was not performed. :param calib_attrs: Calibration attributes. :param inputs: Properties of the inputs. It has quantization scales of the input tensors and attributes of the nodes that calculate the inputs. :returns: Tuple of observed distribution and dictionary of intermediate observed distributions. .. py:class:: AwesomeOperation An abstract class Stores a list of input key names expected to be passed in by the AwesomeNode for developer reference. .. attribute:: input_list ClassVar[Optional[List[InputName]]]. Used as reference when getting inputs from a dictionary. If input_list is None, AFE will skip validating input_list at runtime .. attribute:: observer_behavior How observers are used in a node during calibration .. py:attribute:: input_list :type: ClassVar[afe.ir.attributes.Optional[afe.ir.attributes.List[afe.ir.defines.InputName]]] :value: [] .. py:attribute:: observer_behavior :type: ClassVar[ObserverBehavior] .. py:method:: get_type(attrs: afe.ir.attributes.Union[AWESOME_ATTRS, QUANT_ATTRS]) -> afe.ir.tensor_type.NodeType :classmethod: :abstractmethod: Get the type of this node given its attributes. The parameter should be a QUANT_ATTRS if that data has been created, or an AWESOME_ATTRIBUTES otherwise. :param attrs: Attributes associated with the operator. It is an AWESOME_ATTRIBUTES if quantization has not transformed the node, or a QUANT_ATTRS if it has. :return: The node's type. .. py:method:: run(attrs: AWESOME_ATTRS, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.Any], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.Any :classmethod: :abstractmethod: Executes the operation in floating point :param attrs: AwesomeAttributes associated with this operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:method:: run_quant(quant_attrs: QUANT_ATTRS, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.Any], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.Any :classmethod: :abstractmethod: Execute the operation using quantized arithmetic. :param quant_attrs: Parameters that define the quantized operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:method:: calibrate(attrs: AWESOME_ATTRS, calib_attrs: afe.ir.attributes.AwesomeCalibAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.Any], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.Any :classmethod: The default calibration method. Executes the operation in floating point. Update the observer if the operation is associated with one. Otherwise, the operation's quantization parameters will be calculated based on it's input's quantization parameters. Update the min/max values using the outputs and use the updated min/max to compute the scales and zero points. :param attrs: AwesomeAttributes associated with this operation :param calib_attrs: AwesomeCalibAttrs associated with operation's node. :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :return: Output tensor(s) whose type is dependent on the subclass. .. py:method:: update_input_quant(calib_attrs: afe.ir.attributes.AwesomeCalibAttrs, input_dict: Mapping[afe.ir.defines.InputName, afe.ir.attributes.Optional[afe.ir.defines.DataValue[afe.ir.attributes.QuantResultTensorType]]]) :classmethod: Record quantization scales of the input tensors. :param calib_attrs: Calibration results holding dynamic ranges. It will be updated with quantization parameters of the node's inputs. :param input_dict: Quantization parameters of the node's inputs. .. py:method:: quantize(attrs: AWESOME_ATTRS, quantizer_interface: afe.ir.quantization_interface.OpQuantInterface, config: afe.core.configs.QuantizationConfigs, error_reporter: afe.ir.defines.NodeReporter) -> QUANT_ATTRS :classmethod: :abstractmethod: Compute quantized operator attributes, input quantization, and output quantization from floating-point operator attributes and the result of calibration. When this function is called, calib_attrs.input_quant has the types and quantization of the input values (after the inputs have been transformed by quantization), and calib_attrs.quant holds a type and quantization of the output, which this function may overwrite. The output quantization is computed based on calibration. The output type should not be used. This function must assign to calib_attrs.quant the output type and quantization that this operator has after quantization. It may use the default quantization if appropriate. This function may modify attrs. It should modify attrs if the same attribute class is used for both the floating-point and the quantized operator, which would mean that it's designed to store any quantization information in attrs. This function may modify calib_attrs.input_quant to direct quantization to supply different inputs to this operator. The quantization algorithm will insert quantize or dequantize nodes so that the inputs have the type and quantization that were assigned. An exception will be raised if the input can't be provided by inserting a quantize or dequantize node or leaving the input unchanged. The quantized operator attributes are returned. :param attrs: Floating-point operator attributes. :param quantizer_interface: Quantization-related properties of a node's interface before and after quantization, for use when quantizing the node. :param config: Parameters controlling how to quantize. :param error_reporter: Node reporter of the node to be quantized. :returns: Quantized operator attributes. .. py:method:: type_check(value: afe.ir.attributes.Any, expected_type: Type[T]) -> T :classmethod: Each op expects a more specific type of inputs / AwesomeAttributes so this function helps with type checking :param value: AwesomeAttributes :param expected_type: a type .. py:class:: PlaceholderOp An abstract class Stores a list of input key names expected to be passed in by the AwesomeNode for developer reference. .. attribute:: input_list ClassVar[Optional[List[InputName]]]. Used as reference when getting inputs from a dictionary. If input_list is None, AFE will skip validating input_list at runtime .. attribute:: observer_behavior How observers are used in a node during calibration .. py:attribute:: input_list :type: ClassVar[afe.ir.attributes.List[afe.ir.defines.InputName]] .. py:attribute:: observer_behavior :type: ClassVar[ObserverBehavior] .. py:attribute:: placeholder_fn :type: Callable[[afe.ir.attributes.np.ndarray], afe.ir.attributes.np.ndarray] .. py:attribute:: quant_fn :type: Callable[[afe.ir.attributes.np.ndarray, float, int, int], afe.ir.attributes.np.ndarray] .. py:method:: get_type(attrs: afe.ir.attributes.Union[afe.ir.attributes.PlaceholderAttrs, afe.ir.attributes.PlaceholderQuantAttrs]) -> afe.ir.tensor_type.NodeType :classmethod: Get the type of this node given its attributes. The parameter should be a QUANT_ATTRS if that data has been created, or an AWESOME_ATTRIBUTES otherwise. :param attrs: Attributes associated with the operator. It is an AWESOME_ATTRIBUTES if quantization has not transformed the node, or a QUANT_ATTRS if it has. :return: The node's type. .. py:method:: run(attrs: afe.ir.attributes.PlaceholderAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.Any], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Executes the operation in floating point :param attrs: AwesomeAttributes associated with this operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:method:: update_input_quant(calib_attrs: afe.ir.attributes.AwesomeCalibAttrs, input_dict: Mapping[afe.ir.defines.InputName, afe.ir.attributes.Optional[afe.ir.defines.DataValue[afe.ir.attributes.QuantResultTensorType]]]) :classmethod: Record quantization scales of the input tensors. :param calib_attrs: Calibration results holding dynamic ranges. It will be updated with quantization scales of the node's inputs. :param input_dict: Quantization scales of the node's inputs. .. py:method:: quantize(attrs: afe.ir.attributes.PlaceholderAttrs, quantizer_interface: afe.ir.quantization_interface.OpQuantInterface, config: afe.core.configs.QuantizationConfigs, error_reporter: afe.ir.defines.NodeReporter) -> afe.ir.attributes.PlaceholderQuantAttrs :classmethod: Compute quantized operator attributes, input quantization, and output quantization from floating-point operator attributes and the result of calibration. When this function is called, calib_attrs.input_quant has the types and quantization of the input values (after the inputs have been transformed by quantization), and calib_attrs.quant holds a type and quantization of the output, which this function may overwrite. The output quantization is computed based on calibration. The output type should not be used. This function must assign to calib_attrs.quant the output type and quantization that this operator has after quantization. It may use the default quantization if appropriate. This function may modify attrs. It should modify attrs if the same attribute class is used for both the floating-point and the quantized operator, which would mean that it's designed to store any quantization information in attrs. This function may modify calib_attrs.input_quant to direct quantization to supply different inputs to this operator. The quantization algorithm will insert quantize or dequantize nodes so that the inputs have the type and quantization that were assigned. An exception will be raised if the input can't be provided by inserting a quantize or dequantize node or leaving the input unchanged. The quantized operator attributes are returned. :param attrs: Floating-point operator attributes. :param quantizer_interface: Quantization-related properties of a node's interface before and after quantization, for use when quantizing the node. :param config: Parameters controlling how to quantize. :param error_reporter: Node reporter of the node to be quantized. :returns: Quantized operator attributes. .. py:method:: run_quant(quant_attrs: afe.ir.attributes.PlaceholderQuantAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.Any], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Execute the operation using quantized arithmetic. :param quant_attrs: Parameters that define the quantized operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:class:: ConstantOp An abstract class Stores a list of input key names expected to be passed in by the AwesomeNode for developer reference. .. attribute:: input_list ClassVar[Optional[List[InputName]]]. Used as reference when getting inputs from a dictionary. If input_list is None, AFE will skip validating input_list at runtime .. attribute:: observer_behavior How observers are used in a node during calibration .. py:attribute:: constant_fn :type: Callable[[afe.ir.attributes.np.ndarray], afe.ir.attributes.np.ndarray] .. py:attribute:: observer_behavior :type: ClassVar[ObserverBehavior] .. py:method:: get_type(attrs: afe.ir.attributes.Union[afe.ir.attributes.ConstantAttrs, afe.ir.attributes.ConstantQuantAttrs]) -> afe.ir.tensor_type.NodeType :classmethod: Get the type of this node given its attributes. The parameter should be a QUANT_ATTRS if that data has been created, or an AWESOME_ATTRIBUTES otherwise. :param attrs: Attributes associated with the operator. It is an AWESOME_ATTRIBUTES if quantization has not transformed the node, or a QUANT_ATTRS if it has. :return: The node's type. .. py:method:: run(attrs: afe.ir.attributes.ConstantAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.Any], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Executes the operation in floating point :param attrs: AwesomeAttributes associated with this operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:method:: calibrate(attrs: afe.ir.attributes.ConstantAttrs, calib_attrs: afe.ir.attributes.AwesomeCalibAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.Any], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: The default calibration method. Executes the operation in floating point. Update the observer if the operation is associated with one. Otherwise, the operation's quantization parameters will be calculated based on it's input's quantization parameters. Update the min/max values using the outputs and use the updated min/max to compute the scales and zero points. :param attrs: AwesomeAttributes associated with this operation :param calib_attrs: AwesomeCalibAttrs associated with operation's node. :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :return: Output tensor(s) whose type is dependent on the subclass. .. py:method:: quantize(attrs: afe.ir.attributes.ConstantAttrs, quantizer_interface: afe.ir.quantization_interface.OpQuantInterface, config: afe.core.configs.QuantizationConfigs, error_reporter: afe.ir.defines.NodeReporter) -> afe.ir.attributes.Union[afe.ir.attributes.ConstantAttrs, afe.ir.attributes.ConstantQuantAttrs] :classmethod: Compute quantized operator attributes, input quantization, and output quantization from floating-point operator attributes and the result of calibration. When this function is called, calib_attrs.input_quant has the types and quantization of the input values (after the inputs have been transformed by quantization), and calib_attrs.quant holds a type and quantization of the output, which this function may overwrite. The output quantization is computed based on calibration. The output type should not be used. This function must assign to calib_attrs.quant the output type and quantization that this operator has after quantization. It may use the default quantization if appropriate. This function may modify attrs. It should modify attrs if the same attribute class is used for both the floating-point and the quantized operator, which would mean that it's designed to store any quantization information in attrs. This function may modify calib_attrs.input_quant to direct quantization to supply different inputs to this operator. The quantization algorithm will insert quantize or dequantize nodes so that the inputs have the type and quantization that were assigned. An exception will be raised if the input can't be provided by inserting a quantize or dequantize node or leaving the input unchanged. The quantized operator attributes are returned. :param attrs: Floating-point operator attributes. :param quantizer_interface: Quantization-related properties of a node's interface before and after quantization, for use when quantizing the node. :param config: Parameters controlling how to quantize. :param error_reporter: Node reporter of the node to be quantized. :returns: Quantized operator attributes. .. py:method:: run_quant(quant_attrs: afe.ir.attributes.ConstantQuantAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.Any], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Execute the operation using quantized arithmetic. :param quant_attrs: Parameters that define the quantized operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:class:: MaxPool2DOp An abstract class Stores a list of input key names expected to be passed in by the AwesomeNode for developer reference. .. attribute:: input_list ClassVar[Optional[List[InputName]]]. Used as reference when getting inputs from a dictionary. If input_list is None, AFE will skip validating input_list at runtime .. attribute:: observer_behavior How observers are used in a node during calibration .. py:attribute:: input_list :type: ClassVar[afe.ir.attributes.List[afe.ir.defines.InputName]] .. py:class:: MaxPool3DOp An abstract class Stores a list of input key names expected to be passed in by the AwesomeNode for developer reference. .. attribute:: input_list ClassVar[Optional[List[InputName]]]. Used as reference when getting inputs from a dictionary. If input_list is None, AFE will skip validating input_list at runtime .. attribute:: observer_behavior How observers are used in a node during calibration .. py:attribute:: input_list :type: ClassVar[afe.ir.attributes.List[afe.ir.defines.InputName]] .. py:class:: AvgPool2DOp An abstract class Stores a list of input key names expected to be passed in by the AwesomeNode for developer reference. .. attribute:: input_list ClassVar[Optional[List[InputName]]]. Used as reference when getting inputs from a dictionary. If input_list is None, AFE will skip validating input_list at runtime .. attribute:: observer_behavior How observers are used in a node during calibration .. py:attribute:: input_list :type: ClassVar[afe.ir.attributes.List[afe.ir.defines.InputName]] .. py:class:: AvgPool3DOp An abstract class Stores a list of input key names expected to be passed in by the AwesomeNode for developer reference. .. attribute:: input_list ClassVar[Optional[List[InputName]]]. Used as reference when getting inputs from a dictionary. If input_list is None, AFE will skip validating input_list at runtime .. attribute:: observer_behavior How observers are used in a node during calibration .. py:attribute:: input_list :type: ClassVar[afe.ir.attributes.List[afe.ir.defines.InputName]] .. py:class:: VarianceOp An abstract class Stores a list of input key names expected to be passed in by the AwesomeNode for developer reference. .. attribute:: input_list ClassVar[Optional[List[InputName]]]. Used as reference when getting inputs from a dictionary. If input_list is None, AFE will skip validating input_list at runtime .. attribute:: observer_behavior How observers are used in a node during calibration .. py:attribute:: input_list :type: ClassVar[list[afe.ir.defines.InputName]] .. py:attribute:: observer_behavior :type: ClassVar[ObserverBehavior] .. py:attribute:: var_fn .. py:method:: get_type(attrs: afe.ir.attributes.VarianceAttrs | afe.ir.attributes.VarianceQuantAttrs) -> afe.ir.tensor_type.NodeType :classmethod: Get the type of this node given its attributes. The parameter should be a QUANT_ATTRS if that data has been created, or an AWESOME_ATTRIBUTES otherwise. :param attrs: Attributes associated with the operator. It is an AWESOME_ATTRIBUTES if quantization has not transformed the node, or a QUANT_ATTRS if it has. :return: The node's type. .. py:method:: run(attrs: afe.ir.attributes.VarianceAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.np.ndarray], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Executes the operation in floating point :param attrs: AwesomeAttributes associated with this operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:method:: quantize(attrs: afe.ir.attributes.VarianceAttrs, quantizer_interface: afe.ir.quantization_interface.OpQuantInterface, config: afe.core.configs.QuantizationConfigs, error_reporter: afe.ir.defines.NodeReporter) -> afe.ir.attributes.VarianceAttrs | afe.ir.attributes.VarianceQuantAttrs :classmethod: Compute quantized operator attributes, input quantization, and output quantization from floating-point operator attributes and the result of calibration. When this function is called, calib_attrs.input_quant has the types and quantization of the input values (after the inputs have been transformed by quantization), and calib_attrs.quant holds a type and quantization of the output, which this function may overwrite. The output quantization is computed based on calibration. The output type should not be used. This function must assign to calib_attrs.quant the output type and quantization that this operator has after quantization. It may use the default quantization if appropriate. This function may modify attrs. It should modify attrs if the same attribute class is used for both the floating-point and the quantized operator, which would mean that it's designed to store any quantization information in attrs. This function may modify calib_attrs.input_quant to direct quantization to supply different inputs to this operator. The quantization algorithm will insert quantize or dequantize nodes so that the inputs have the type and quantization that were assigned. An exception will be raised if the input can't be provided by inserting a quantize or dequantize node or leaving the input unchanged. The quantized operator attributes are returned. :param attrs: Floating-point operator attributes. :param quantizer_interface: Quantization-related properties of a node's interface before and after quantization, for use when quantizing the node. :param config: Parameters controlling how to quantize. :param error_reporter: Node reporter of the node to be quantized. :returns: Quantized operator attributes. .. py:method:: run_quant(quant_attrs: QUANT_ATTRS, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.Any], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.Any :classmethod: Execute the operation using quantized arithmetic. :param quant_attrs: Parameters that define the quantized operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:class:: MultiplyOp An abstract class Stores a list of input key names expected to be passed in by the AwesomeNode for developer reference. .. attribute:: input_list ClassVar[Optional[List[InputName]]]. Used as reference when getting inputs from a dictionary. If input_list is None, AFE will skip validating input_list at runtime .. attribute:: observer_behavior How observers are used in a node during calibration .. py:attribute:: input_list :type: ClassVar[afe.ir.attributes.List[afe.ir.defines.InputName]] .. py:attribute:: observer_behavior :type: ClassVar[ObserverBehavior] .. py:method:: get_type(attrs: afe.ir.attributes.Union[afe.ir.attributes.MultiplyAttrs, afe.ir.attributes.MultiplyQuantAttrs]) -> afe.ir.tensor_type.NodeType :classmethod: Get the type of this node given its attributes. The parameter should be a QUANT_ATTRS if that data has been created, or an AWESOME_ATTRIBUTES otherwise. :param attrs: Attributes associated with the operator. It is an AWESOME_ATTRIBUTES if quantization has not transformed the node, or a QUANT_ATTRS if it has. :return: The node's type. .. py:method:: run(attrs: afe.ir.attributes.AwesomeAttributes, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.np.ndarray], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Executes the operation in floating point :param attrs: AwesomeAttributes associated with this operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:method:: quantize(attrs: afe.ir.attributes.MultiplyAttrs, quantizer_interface: afe.ir.quantization_interface.OpQuantInterface, config: afe.core.configs.QuantizationConfigs, error_reporter: afe.ir.defines.NodeReporter) -> afe.ir.attributes.Union[afe.ir.attributes.MultiplyAttrs, afe.ir.attributes.MultiplyQuantAttrs] :classmethod: Compute quantized operator attributes, input quantization, and output quantization from floating-point operator attributes and the result of calibration. When this function is called, calib_attrs.input_quant has the types and quantization of the input values (after the inputs have been transformed by quantization), and calib_attrs.quant holds a type and quantization of the output, which this function may overwrite. The output quantization is computed based on calibration. The output type should not be used. This function must assign to calib_attrs.quant the output type and quantization that this operator has after quantization. It may use the default quantization if appropriate. This function may modify attrs. It should modify attrs if the same attribute class is used for both the floating-point and the quantized operator, which would mean that it's designed to store any quantization information in attrs. This function may modify calib_attrs.input_quant to direct quantization to supply different inputs to this operator. The quantization algorithm will insert quantize or dequantize nodes so that the inputs have the type and quantization that were assigned. An exception will be raised if the input can't be provided by inserting a quantize or dequantize node or leaving the input unchanged. The quantized operator attributes are returned. :param attrs: Floating-point operator attributes. :param quantizer_interface: Quantization-related properties of a node's interface before and after quantization, for use when quantizing the node. :param config: Parameters controlling how to quantize. :param error_reporter: Node reporter of the node to be quantized. :returns: Quantized operator attributes. .. py:method:: run_quant(quant_attrs: afe.ir.attributes.MultiplyQuantAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.Any], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Execute the operation using quantized arithmetic. :param quant_attrs: Parameters that define the quantized operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:class:: PadOp An abstract class Stores a list of input key names expected to be passed in by the AwesomeNode for developer reference. .. attribute:: input_list ClassVar[Optional[List[InputName]]]. Used as reference when getting inputs from a dictionary. If input_list is None, AFE will skip validating input_list at runtime .. attribute:: observer_behavior How observers are used in a node during calibration .. py:attribute:: input_list :type: ClassVar[afe.ir.attributes.List[afe.ir.defines.InputName]] .. py:attribute:: pad_fn :type: Callable[[afe.ir.attributes.PadAttrs, afe.ir.attributes.np.ndarray, afe.ir.attributes.np.ndarray], afe.ir.attributes.np.ndarray] .. py:method:: get_type(attrs: afe.ir.attributes.Union[afe.ir.attributes.PadAttrs, afe.ir.attributes.AwesomeQuantAttrBase]) -> afe.ir.tensor_type.NodeType :classmethod: Get the type of this node given its attributes. The parameter should be a QUANT_ATTRS if that data has been created, or an AWESOME_ATTRIBUTES otherwise. :param attrs: Attributes associated with the operator. It is an AWESOME_ATTRIBUTES if quantization has not transformed the node, or a QUANT_ATTRS if it has. :return: The node's type. .. py:method:: run(attrs: afe.ir.attributes.PadAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.np.ndarray], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Executes the operation in floating point :param attrs: AwesomeAttributes associated with this operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:class:: MeanOp An abstract class Stores a list of input key names expected to be passed in by the AwesomeNode for developer reference. .. attribute:: input_list ClassVar[Optional[List[InputName]]]. Used as reference when getting inputs from a dictionary. If input_list is None, AFE will skip validating input_list at runtime .. attribute:: observer_behavior How observers are used in a node during calibration .. py:attribute:: input_list :type: ClassVar[afe.ir.attributes.List[afe.ir.defines.InputName]] .. py:attribute:: observer_behavior :type: ClassVar[ObserverBehavior] .. py:attribute:: mean_fn :type: Callable[[afe.ir.attributes.ReduceAttrs, afe.ir.attributes.np.ndarray], afe.ir.attributes.np.ndarray] .. py:method:: get_type(attrs: afe.ir.attributes.Union[afe.ir.attributes.ReduceAttrs, afe.ir.attributes.MeanQuantAttrs]) -> afe.ir.tensor_type.NodeType :classmethod: Get the type of this node given its attributes. The parameter should be a QUANT_ATTRS if that data has been created, or an AWESOME_ATTRIBUTES otherwise. :param attrs: Attributes associated with the operator. It is an AWESOME_ATTRIBUTES if quantization has not transformed the node, or a QUANT_ATTRS if it has. :return: The node's type. .. py:method:: run(attrs: afe.ir.attributes.ReduceAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.np.ndarray], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Executes the operation in floating point :param attrs: AwesomeAttributes associated with this operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:method:: quantize(attrs: afe.ir.attributes.ReduceAttrs, quantizer_interface: afe.ir.quantization_interface.OpQuantInterface, config: afe.core.configs.QuantizationConfigs, error_reporter: afe.ir.defines.NodeReporter) -> afe.ir.attributes.MeanQuantAttrs :classmethod: Compute quantized operator attributes, input quantization, and output quantization from floating-point operator attributes and the result of calibration. When this function is called, calib_attrs.input_quant has the types and quantization of the input values (after the inputs have been transformed by quantization), and calib_attrs.quant holds a type and quantization of the output, which this function may overwrite. The output quantization is computed based on calibration. The output type should not be used. This function must assign to calib_attrs.quant the output type and quantization that this operator has after quantization. It may use the default quantization if appropriate. This function may modify attrs. It should modify attrs if the same attribute class is used for both the floating-point and the quantized operator, which would mean that it's designed to store any quantization information in attrs. This function may modify calib_attrs.input_quant to direct quantization to supply different inputs to this operator. The quantization algorithm will insert quantize or dequantize nodes so that the inputs have the type and quantization that were assigned. An exception will be raised if the input can't be provided by inserting a quantize or dequantize node or leaving the input unchanged. The quantized operator attributes are returned. :param attrs: Floating-point operator attributes. :param quantizer_interface: Quantization-related properties of a node's interface before and after quantization, for use when quantizing the node. :param config: Parameters controlling how to quantize. :param error_reporter: Node reporter of the node to be quantized. :returns: Quantized operator attributes. .. py:method:: run_quant(quant_attrs: afe.ir.attributes.MeanQuantAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.np.ndarray], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Execute the operation using quantized arithmetic. :param quant_attrs: Parameters that define the quantized operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:class:: ArgMaxOp An abstract class Stores a list of input key names expected to be passed in by the AwesomeNode for developer reference. .. attribute:: input_list ClassVar[Optional[List[InputName]]]. Used as reference when getting inputs from a dictionary. If input_list is None, AFE will skip validating input_list at runtime .. attribute:: observer_behavior How observers are used in a node during calibration .. py:attribute:: input_list :type: ClassVar[afe.ir.attributes.List[afe.ir.defines.InputName]] .. py:attribute:: observer_behavior :type: ClassVar[ObserverBehavior] .. py:attribute:: argmax_fn :type: Callable[[afe.ir.attributes.ArgMaxAttrs, afe.ir.attributes.np.ndarray], afe.ir.attributes.np.ndarray] .. py:method:: get_type(attrs: afe.ir.attributes.Union[afe.ir.attributes.ArgMaxAttrs, afe.ir.attributes.ArgMaxQuantAttrs]) -> afe.ir.tensor_type.NodeType :classmethod: Get the type of this node given its attributes. The parameter should be a QUANT_ATTRS if that data has been created, or an AWESOME_ATTRIBUTES otherwise. :param attrs: Attributes associated with the operator. It is an AWESOME_ATTRIBUTES if quantization has not transformed the node, or a QUANT_ATTRS if it has. :return: The node's type. .. py:method:: quantize(attrs: afe.ir.attributes.ArgMaxAttrs, quantizer_interface: afe.ir.quantization_interface.OpQuantInterface, config: afe.core.configs.QuantizationConfigs, error_reporter: afe.ir.defines.NodeReporter) -> afe.ir.attributes.ArgMaxQuantAttrs :classmethod: Quantize argmax. The quantized operator takes int8 or bfloat16 values and returns int32 values. The int32 values represent an array index, not real numbers, so they do not have quantization scale. No quantization info is saved in attrs, as argmax's computation is oblivious to quantization. .. py:method:: run(attrs: afe.ir.attributes.ArgMaxAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.np.ndarray], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Executes the operation in floating point :param attrs: AwesomeAttributes associated with this operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:method:: run_quant(attrs: afe.ir.attributes.ArgMaxQuantAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.np.ndarray], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Execute the operation using quantized arithmetic. :param quant_attrs: Parameters that define the quantized operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:class:: SoftmaxOp An abstract class Stores a list of input key names expected to be passed in by the AwesomeNode for developer reference. .. attribute:: input_list ClassVar[Optional[List[InputName]]]. Used as reference when getting inputs from a dictionary. If input_list is None, AFE will skip validating input_list at runtime .. attribute:: observer_behavior How observers are used in a node during calibration .. py:attribute:: input_list :type: ClassVar[afe.ir.attributes.List[afe.ir.defines.InputName]] .. py:attribute:: observer_behavior :type: ClassVar[ObserverBehavior] .. py:attribute:: softmax_fn :type: Callable[[afe.ir.attributes.SoftmaxAttrs, afe.ir.attributes.np.ndarray, afe.ir.operation_functions.RunMode], afe.ir.attributes.np.ndarray] .. py:method:: get_type(attrs: afe.ir.attributes.Union[afe.ir.attributes.SoftmaxAttrs, afe.ir.attributes.SoftmaxQuantAttrs]) -> afe.ir.tensor_type.NodeType :classmethod: Get the type of this node given its attributes. The parameter should be a QUANT_ATTRS if that data has been created, or an AWESOME_ATTRIBUTES otherwise. :param attrs: Attributes associated with the operator. It is an AWESOME_ATTRIBUTES if quantization has not transformed the node, or a QUANT_ATTRS if it has. :return: The node's type. .. py:method:: run(attrs: afe.ir.attributes.SoftmaxAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.np.ndarray], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Executes the operation in floating point :param attrs: AwesomeAttributes associated with this operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:method:: quantize(attrs: afe.ir.attributes.SoftmaxAttrs, quantizer_interface: afe.ir.quantization_interface.OpQuantInterface, config: afe.core.configs.QuantizationConfigs, error_reporter: afe.ir.defines.NodeReporter) -> afe.ir.attributes.Union[afe.ir.attributes.SoftmaxAttrs, afe.ir.attributes.SoftmaxQuantAttrs] :classmethod: Compute quantized operator attributes, input quantization, and output quantization from floating-point operator attributes and the result of calibration. When this function is called, calib_attrs.input_quant has the types and quantization of the input values (after the inputs have been transformed by quantization), and calib_attrs.quant holds a type and quantization of the output, which this function may overwrite. The output quantization is computed based on calibration. The output type should not be used. This function must assign to calib_attrs.quant the output type and quantization that this operator has after quantization. It may use the default quantization if appropriate. This function may modify attrs. It should modify attrs if the same attribute class is used for both the floating-point and the quantized operator, which would mean that it's designed to store any quantization information in attrs. This function may modify calib_attrs.input_quant to direct quantization to supply different inputs to this operator. The quantization algorithm will insert quantize or dequantize nodes so that the inputs have the type and quantization that were assigned. An exception will be raised if the input can't be provided by inserting a quantize or dequantize node or leaving the input unchanged. The quantized operator attributes are returned. :param attrs: Floating-point operator attributes. :param quantizer_interface: Quantization-related properties of a node's interface before and after quantization, for use when quantizing the node. :param config: Parameters controlling how to quantize. :param error_reporter: Node reporter of the node to be quantized. :returns: Quantized operator attributes. .. py:method:: run_quant(quant_attrs: afe.ir.attributes.SoftmaxQuantAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.np.ndarray], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Execute the operation using quantized arithmetic. :param quant_attrs: Parameters that define the quantized operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:method:: calibrate(attrs: AWESOME_ATTRS, calib_attrs: afe.ir.attributes.AwesomeCalibAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.Any], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.Any :classmethod: Softmax calibration method. Executes default calibration to get results of Softmax operation in floating point. Additionally, calculate intermediate results and update the observers for intermediate values. :param attrs: AwesomeAttributes associated with this operation :param calib_attrs: AwesomeCalibAttrs associated with operation's node. :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Parameters controlling how to calibrate. :return: Output tensor(s) whose type is dependent on the subclass. .. py:class:: LRNOp An abstract class Stores a list of input key names expected to be passed in by the AwesomeNode for developer reference. .. attribute:: input_list ClassVar[Optional[List[InputName]]]. Used as reference when getting inputs from a dictionary. If input_list is None, AFE will skip validating input_list at runtime .. attribute:: observer_behavior How observers are used in a node during calibration .. py:attribute:: input_list :type: ClassVar[afe.ir.attributes.List[afe.ir.defines.InputName]] .. py:attribute:: observer_behavior :type: ClassVar[ObserverBehavior] .. py:attribute:: lrn_fn :type: Callable[[afe.ir.attributes.LRNAttrs, afe.ir.attributes.np.ndarray], afe.ir.attributes.np.ndarray] .. py:method:: get_type(attrs: afe.ir.attributes.Union[afe.ir.attributes.LRNAttrs, afe.ir.attributes.LRNQuantAttrs]) -> afe.ir.tensor_type.NodeType :classmethod: Get the type of this node given its attributes. The parameter should be a QUANT_ATTRS if that data has been created, or an AWESOME_ATTRIBUTES otherwise. :param attrs: Attributes associated with the operator. It is an AWESOME_ATTRIBUTES if quantization has not transformed the node, or a QUANT_ATTRS if it has. :return: The node's type. .. py:method:: run(attrs: afe.ir.attributes.LRNAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.np.ndarray], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Executes the operation in floating point :param attrs: AwesomeAttributes associated with this operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:method:: quantize(attrs: afe.ir.attributes.LRNAttrs, quantizer_interface: afe.ir.quantization_interface.OpQuantInterface, config: afe.core.configs.QuantizationConfigs, error_reporter: afe.ir.defines.NodeReporter) -> afe.ir.attributes.LRNQuantAttrs :classmethod: Compute quantized operator attributes, input quantization, and output quantization from floating-point operator attributes and the result of calibration. When this function is called, calib_attrs.input_quant has the types and quantization of the input values (after the inputs have been transformed by quantization), and calib_attrs.quant holds a type and quantization of the output, which this function may overwrite. The output quantization is computed based on calibration. The output type should not be used. This function must assign to calib_attrs.quant the output type and quantization that this operator has after quantization. It may use the default quantization if appropriate. This function may modify attrs. It should modify attrs if the same attribute class is used for both the floating-point and the quantized operator, which would mean that it's designed to store any quantization information in attrs. This function may modify calib_attrs.input_quant to direct quantization to supply different inputs to this operator. The quantization algorithm will insert quantize or dequantize nodes so that the inputs have the type and quantization that were assigned. An exception will be raised if the input can't be provided by inserting a quantize or dequantize node or leaving the input unchanged. The quantized operator attributes are returned. :param attrs: Floating-point operator attributes. :param quantizer_interface: Quantization-related properties of a node's interface before and after quantization, for use when quantizing the node. :param config: Parameters controlling how to quantize. :param error_reporter: Node reporter of the node to be quantized. :returns: Quantized operator attributes. .. py:method:: run_quant(quant_attrs: afe.ir.attributes.LRNQuantAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.np.ndarray], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Execute the operation using quantized arithmetic. :param quant_attrs: Parameters that define the quantized operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:class:: ExtmOp Extremum op, can be either min or max operation. Attributes contain a boolean to determine the operation. .. py:attribute:: input_list :type: ClassVar[afe.ir.attributes.List[afe.ir.defines.InputName]] .. py:attribute:: observer_behavior :type: ClassVar[ObserverBehavior] .. py:attribute:: min_fn :type: Callable[[afe.ir.attributes.ExtmAttrs, afe.ir.attributes.np.ndarray], afe.ir.attributes.np.ndarray] .. py:attribute:: max_fn :type: Callable[[afe.ir.attributes.ExtmAttrs, afe.ir.attributes.np.ndarray], afe.ir.attributes.np.ndarray] .. py:method:: get_type(attrs: afe.ir.attributes.Union[afe.ir.attributes.ExtmAttrs, afe.ir.attributes.ExtmQuantAttrs]) -> afe.ir.tensor_type.NodeType :classmethod: Get the type of this node given its attributes. The parameter should be a QUANT_ATTRS if that data has been created, or an AWESOME_ATTRIBUTES otherwise. :param attrs: Attributes associated with the operator. It is an AWESOME_ATTRIBUTES if quantization has not transformed the node, or a QUANT_ATTRS if it has. :return: The node's type. .. py:method:: run(attrs: afe.ir.attributes.ExtmAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.np.ndarray], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Executes the operation in floating point :param attrs: AwesomeAttributes associated with this operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:method:: quantize(attrs: afe.ir.attributes.ExtmAttrs, quantizer_interface: afe.ir.quantization_interface.OpQuantInterface, config: afe.core.configs.QuantizationConfigs, error_reporter: afe.ir.defines.NodeReporter) -> afe.ir.attributes.Union[afe.ir.attributes.ExtmAttrs, afe.ir.attributes.ExtmQuantAttrs] :classmethod: Compute quantized operator attributes, input quantization, and output quantization from floating-point operator attributes and the result of calibration. When this function is called, calib_attrs.input_quant has the types and quantization of the input values (after the inputs have been transformed by quantization), and calib_attrs.quant holds a type and quantization of the output, which this function may overwrite. The output quantization is computed based on calibration. The output type should not be used. This function must assign to calib_attrs.quant the output type and quantization that this operator has after quantization. It may use the default quantization if appropriate. This function may modify attrs. It should modify attrs if the same attribute class is used for both the floating-point and the quantized operator, which would mean that it's designed to store any quantization information in attrs. This function may modify calib_attrs.input_quant to direct quantization to supply different inputs to this operator. The quantization algorithm will insert quantize or dequantize nodes so that the inputs have the type and quantization that were assigned. An exception will be raised if the input can't be provided by inserting a quantize or dequantize node or leaving the input unchanged. The quantized operator attributes are returned. :param attrs: Floating-point operator attributes. :param quantizer_interface: Quantization-related properties of a node's interface before and after quantization, for use when quantizing the node. :param config: Parameters controlling how to quantize. :param error_reporter: Node reporter of the node to be quantized. :returns: Quantized operator attributes. .. py:method:: run_quant(quant_attrs: afe.ir.attributes.ExtmQuantAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.np.ndarray], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Execute the operation using quantized arithmetic. :param quant_attrs: Parameters that define the quantized operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:class:: SumOp An abstract class Stores a list of input key names expected to be passed in by the AwesomeNode for developer reference. .. attribute:: input_list ClassVar[Optional[List[InputName]]]. Used as reference when getting inputs from a dictionary. If input_list is None, AFE will skip validating input_list at runtime .. attribute:: observer_behavior How observers are used in a node during calibration .. py:attribute:: input_list :type: ClassVar[afe.ir.attributes.List[afe.ir.defines.InputName]] .. py:attribute:: observer_behavior :type: ClassVar[ObserverBehavior] .. py:attribute:: sum_fn :type: Callable[[afe.ir.attributes.ReduceAttrs, afe.ir.attributes.np.ndarray], afe.ir.attributes.np.ndarray] .. py:method:: get_type(attrs: afe.ir.attributes.Union[afe.ir.attributes.ReduceAttrs, afe.ir.attributes.ReduceQuantAttrs]) -> afe.ir.tensor_type.NodeType :classmethod: Get the type of this node given its attributes. The parameter should be a QUANT_ATTRS if that data has been created, or an AWESOME_ATTRIBUTES otherwise. :param attrs: Attributes associated with the operator. It is an AWESOME_ATTRIBUTES if quantization has not transformed the node, or a QUANT_ATTRS if it has. :return: The node's type. .. py:method:: run(attrs: afe.ir.attributes.ReduceAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.np.ndarray], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Executes the operation in floating point :param attrs: AwesomeAttributes associated with this operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:method:: quantize(attrs: afe.ir.attributes.ReduceAttrs, quantizer_interface: afe.ir.quantization_interface.OpQuantInterface, config: afe.core.configs.QuantizationConfigs, error_reporter: afe.ir.defines.NodeReporter) -> afe.ir.attributes.ReduceQuantAttrs :classmethod: Compute quantized operator attributes, input quantization, and output quantization from floating-point operator attributes and the result of calibration. When this function is called, calib_attrs.input_quant has the types and quantization of the input values (after the inputs have been transformed by quantization), and calib_attrs.quant holds a type and quantization of the output, which this function may overwrite. The output quantization is computed based on calibration. The output type should not be used. This function must assign to calib_attrs.quant the output type and quantization that this operator has after quantization. It may use the default quantization if appropriate. This function may modify attrs. It should modify attrs if the same attribute class is used for both the floating-point and the quantized operator, which would mean that it's designed to store any quantization information in attrs. This function may modify calib_attrs.input_quant to direct quantization to supply different inputs to this operator. The quantization algorithm will insert quantize or dequantize nodes so that the inputs have the type and quantization that were assigned. An exception will be raised if the input can't be provided by inserting a quantize or dequantize node or leaving the input unchanged. The quantized operator attributes are returned. :param attrs: Floating-point operator attributes. :param quantizer_interface: Quantization-related properties of a node's interface before and after quantization, for use when quantizing the node. :param config: Parameters controlling how to quantize. :param error_reporter: Node reporter of the node to be quantized. :returns: Quantized operator attributes. .. py:method:: run_quant(quant_attrs: afe.ir.attributes.ReduceQuantAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.np.ndarray], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Execute the operation using quantized arithmetic. :param quant_attrs: Parameters that define the quantized operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:class:: ProdOp An abstract class Stores a list of input key names expected to be passed in by the AwesomeNode for developer reference. .. attribute:: input_list ClassVar[Optional[List[InputName]]]. Used as reference when getting inputs from a dictionary. If input_list is None, AFE will skip validating input_list at runtime .. attribute:: observer_behavior How observers are used in a node during calibration .. py:attribute:: input_list :type: ClassVar[afe.ir.attributes.List[afe.ir.defines.InputName]] .. py:attribute:: observer_behavior :type: ClassVar[ObserverBehavior] .. py:attribute:: prod_fn :type: Callable[[afe.ir.attributes.ProdAttrs, afe.ir.attributes.np.ndarray], afe.ir.attributes.np.ndarray] .. py:method:: get_type(attrs: afe.ir.attributes.Union[afe.ir.attributes.ProdAttrs, QUANT_ATTRS]) -> afe.ir.tensor_type.NodeType :classmethod: Get the type of this node given its attributes. The parameter should be a QUANT_ATTRS if that data has been created, or an AWESOME_ATTRIBUTES otherwise. :param attrs: Attributes associated with the operator. It is an AWESOME_ATTRIBUTES if quantization has not transformed the node, or a QUANT_ATTRS if it has. :return: The node's type. .. py:method:: run(attrs: afe.ir.attributes.ProdAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.np.ndarray], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Executes the operation in floating point :param attrs: AwesomeAttributes associated with this operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:class:: SubtractOp An abstract class Stores a list of input key names expected to be passed in by the AwesomeNode for developer reference. .. attribute:: input_list ClassVar[Optional[List[InputName]]]. Used as reference when getting inputs from a dictionary. If input_list is None, AFE will skip validating input_list at runtime .. attribute:: observer_behavior How observers are used in a node during calibration .. py:attribute:: input_list :type: ClassVar[afe.ir.attributes.List[afe.ir.defines.InputName]] .. py:attribute:: observer_behavior :type: ClassVar[ObserverBehavior] .. py:method:: get_type(attrs: afe.ir.attributes.Union[afe.ir.attributes.SubtractAttrs, afe.ir.attributes.SubtractQuantAttrs]) -> afe.ir.tensor_type.NodeType :classmethod: Get the type of this node given its attributes. The parameter should be a QUANT_ATTRS if that data has been created, or an AWESOME_ATTRIBUTES otherwise. :param attrs: Attributes associated with the operator. It is an AWESOME_ATTRIBUTES if quantization has not transformed the node, or a QUANT_ATTRS if it has. :return: The node's type. .. py:method:: run(attrs: afe.ir.attributes.SubtractAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.np.ndarray], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Executes the operation in floating point :param attrs: AwesomeAttributes associated with this operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:method:: quantize(attrs: afe.ir.attributes.SubtractAttrs, quantizer_interface: afe.ir.quantization_interface.OpQuantInterface, config: afe.core.configs.QuantizationConfigs, error_reporter: afe.ir.defines.NodeReporter) -> afe.ir.attributes.Union[afe.ir.attributes.SubtractAttrs, afe.ir.attributes.SubtractQuantAttrs] :classmethod: Compute quantized operator attributes, input quantization, and output quantization from floating-point operator attributes and the result of calibration. When this function is called, calib_attrs.input_quant has the types and quantization of the input values (after the inputs have been transformed by quantization), and calib_attrs.quant holds a type and quantization of the output, which this function may overwrite. The output quantization is computed based on calibration. The output type should not be used. This function must assign to calib_attrs.quant the output type and quantization that this operator has after quantization. It may use the default quantization if appropriate. This function may modify attrs. It should modify attrs if the same attribute class is used for both the floating-point and the quantized operator, which would mean that it's designed to store any quantization information in attrs. This function may modify calib_attrs.input_quant to direct quantization to supply different inputs to this operator. The quantization algorithm will insert quantize or dequantize nodes so that the inputs have the type and quantization that were assigned. An exception will be raised if the input can't be provided by inserting a quantize or dequantize node or leaving the input unchanged. The quantized operator attributes are returned. :param attrs: Floating-point operator attributes. :param quantizer_interface: Quantization-related properties of a node's interface before and after quantization, for use when quantizing the node. :param config: Parameters controlling how to quantize. :param error_reporter: Node reporter of the node to be quantized. :returns: Quantized operator attributes. .. py:method:: run_quant(quant_attrs: afe.ir.attributes.SubtractQuantAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.Any], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Execute the operation using quantized arithmetic. :param quant_attrs: Parameters that define the quantized operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:class:: PowerOp An abstract class Stores a list of input key names expected to be passed in by the AwesomeNode for developer reference. .. attribute:: input_list ClassVar[Optional[List[InputName]]]. Used as reference when getting inputs from a dictionary. If input_list is None, AFE will skip validating input_list at runtime .. attribute:: observer_behavior How observers are used in a node during calibration .. py:attribute:: input_list :type: ClassVar[afe.ir.attributes.List[afe.ir.defines.InputName]] .. py:attribute:: observer_behavior :type: ClassVar[ObserverBehavior] .. py:attribute:: power_fn :type: Callable[[afe.ir.attributes.np.ndarray, afe.ir.attributes.np.ndarray], afe.ir.attributes.np.ndarray] .. py:method:: get_type(attrs: afe.ir.attributes.Union[afe.ir.attributes.PowerAttrs, QUANT_ATTRS]) -> afe.ir.tensor_type.NodeType :classmethod: Get the type of this node given its attributes. The parameter should be a QUANT_ATTRS if that data has been created, or an AWESOME_ATTRIBUTES otherwise. :param attrs: Attributes associated with the operator. It is an AWESOME_ATTRIBUTES if quantization has not transformed the node, or a QUANT_ATTRS if it has. :return: The node's type. .. py:method:: run(attrs: afe.ir.attributes.AwesomeAttributes, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.np.ndarray], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Executes the operation in floating point :param attrs: AwesomeAttributes associated with this operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:class:: MaximumOp An abstract class Stores a list of input key names expected to be passed in by the AwesomeNode for developer reference. .. attribute:: input_list ClassVar[Optional[List[InputName]]]. Used as reference when getting inputs from a dictionary. If input_list is None, AFE will skip validating input_list at runtime .. attribute:: observer_behavior How observers are used in a node during calibration .. py:attribute:: input_list :type: ClassVar[afe.ir.attributes.List[afe.ir.defines.InputName]] .. py:attribute:: observer_behavior :type: ClassVar[ObserverBehavior] .. py:attribute:: maximum_fn :type: Callable[[afe.ir.attributes.np.ndarray, afe.ir.attributes.np.ndarray], afe.ir.attributes.np.ndarray] .. py:method:: get_type(attrs: afe.ir.attributes.Union[afe.ir.attributes.MaximumAttrs, afe.ir.attributes.AwesomeQuantAttrBase]) -> afe.ir.tensor_type.NodeType :classmethod: Get the type of this node given its attributes. The parameter should be a QUANT_ATTRS if that data has been created, or an AWESOME_ATTRIBUTES otherwise. :param attrs: Attributes associated with the operator. It is an AWESOME_ATTRIBUTES if quantization has not transformed the node, or a QUANT_ATTRS if it has. :return: The node's type. .. py:method:: run(attrs: afe.ir.attributes.MaximumAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.np.ndarray], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Executes the operation in floating point :param attrs: AwesomeAttributes associated with this operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:class:: MinimumOp An abstract class Stores a list of input key names expected to be passed in by the AwesomeNode for developer reference. .. attribute:: input_list ClassVar[Optional[List[InputName]]]. Used as reference when getting inputs from a dictionary. If input_list is None, AFE will skip validating input_list at runtime .. attribute:: observer_behavior How observers are used in a node during calibration .. py:attribute:: input_list :type: ClassVar[afe.ir.attributes.List[afe.ir.defines.InputName]] .. py:attribute:: observer_behavior :type: ClassVar[ObserverBehavior] .. py:attribute:: minimum_fn :type: Callable[[afe.ir.attributes.np.ndarray, afe.ir.attributes.np.ndarray], afe.ir.attributes.np.ndarray] .. py:method:: get_type(attrs: afe.ir.attributes.Union[afe.ir.attributes.MinimumAttrs, afe.ir.attributes.AwesomeQuantAttrBase]) -> afe.ir.tensor_type.NodeType :classmethod: Get the type of this node given its attributes. The parameter should be a QUANT_ATTRS if that data has been created, or an AWESOME_ATTRIBUTES otherwise. :param attrs: Attributes associated with the operator. It is an AWESOME_ATTRIBUTES if quantization has not transformed the node, or a QUANT_ATTRS if it has. :return: The node's type. .. py:method:: run(attrs: afe.ir.attributes.AwesomeAttributes, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.np.ndarray], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Executes the operation in floating point :param attrs: AwesomeAttributes associated with this operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:class:: FullOp An abstract class Stores a list of input key names expected to be passed in by the AwesomeNode for developer reference. .. attribute:: input_list ClassVar[Optional[List[InputName]]]. Used as reference when getting inputs from a dictionary. If input_list is None, AFE will skip validating input_list at runtime .. attribute:: observer_behavior How observers are used in a node during calibration .. py:attribute:: input_list :type: ClassVar[afe.ir.attributes.List[afe.ir.defines.InputName]] .. py:attribute:: observer_behavior :type: ClassVar[ObserverBehavior] .. py:attribute:: full_fn :type: Callable[[afe.ir.attributes.FullAttrs, afe.ir.attributes.np.ndarray], afe.ir.attributes.np.ndarray] .. py:method:: run(attrs: afe.ir.attributes.FullAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.np.ndarray], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Executes the operation in floating point :param attrs: AwesomeAttributes associated with this operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:class:: TileOp An abstract class Stores a list of input key names expected to be passed in by the AwesomeNode for developer reference. .. attribute:: input_list ClassVar[Optional[List[InputName]]]. Used as reference when getting inputs from a dictionary. If input_list is None, AFE will skip validating input_list at runtime .. attribute:: observer_behavior How observers are used in a node during calibration .. py:attribute:: input_list :type: ClassVar[afe.ir.attributes.List[afe.ir.defines.InputName]] .. py:attribute:: observer_behavior :type: ClassVar[ObserverBehavior] .. py:attribute:: tile_fn :type: Callable[[afe.ir.attributes.TileAttrs, afe.ir.attributes.np.ndarray], afe.ir.attributes.np.ndarray] .. py:method:: run(attrs: afe.ir.attributes.TileAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.np.ndarray], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Executes the operation in floating point :param attrs: AwesomeAttributes associated with this operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:class:: PReluOp An abstract class Stores a list of input key names expected to be passed in by the AwesomeNode for developer reference. .. attribute:: input_list ClassVar[Optional[List[InputName]]]. Used as reference when getting inputs from a dictionary. If input_list is None, AFE will skip validating input_list at runtime .. attribute:: observer_behavior How observers are used in a node during calibration .. py:attribute:: input_list :type: ClassVar[afe.ir.attributes.List[afe.ir.defines.InputName]] .. py:attribute:: observer_behavior :type: ClassVar[ObserverBehavior] .. py:attribute:: relu_fn :type: Callable[[afe.ir.attributes.np.ndarray, int], afe.ir.attributes.np.ndarray] .. py:attribute:: prelu_fn :type: Callable[[afe.ir.attributes.PReluAttrs, afe.ir.attributes.np.ndarray], afe.ir.attributes.np.ndarray] .. py:attribute:: requantize_fn :type: Callable[[afe.ir.attributes.np.ndarray, int, afe.ir.attributes.Union[int, afe.ir.attributes.np.ndarray], int, bool, str], afe.ir.attributes.np.ndarray] .. py:method:: get_type(attrs: afe.ir.attributes.Union[afe.ir.attributes.PReluAttrs, afe.ir.attributes.PReluQuantAttrs]) -> afe.ir.tensor_type.NodeType :classmethod: Get the type of this node given its attributes. The parameter should be a QUANT_ATTRS if that data has been created, or an AWESOME_ATTRIBUTES otherwise. :param attrs: Attributes associated with the operator. It is an AWESOME_ATTRIBUTES if quantization has not transformed the node, or a QUANT_ATTRS if it has. :return: The node's type. .. py:method:: run(attrs: afe.ir.attributes.PReluAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.np.ndarray], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Executes the operation in floating point :param attrs: AwesomeAttributes associated with this operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:method:: quantize(attrs: afe.ir.attributes.PReluAttrs, quantizer_interface: afe.ir.quantization_interface.OpQuantInterface, configs: afe.core.configs.QuantizationConfigs, error_reporter: afe.ir.defines.NodeReporter) -> afe.ir.attributes.Union[afe.ir.attributes.PReluAttrs, afe.ir.attributes.PReluQuantAttrs] :classmethod: Compute quantized operator attributes, input quantization, and output quantization from floating-point operator attributes and the result of calibration. When this function is called, calib_attrs.input_quant has the types and quantization of the input values (after the inputs have been transformed by quantization), and calib_attrs.quant holds a type and quantization of the output, which this function may overwrite. The output quantization is computed based on calibration. The output type should not be used. This function must assign to calib_attrs.quant the output type and quantization that this operator has after quantization. It may use the default quantization if appropriate. This function may modify attrs. It should modify attrs if the same attribute class is used for both the floating-point and the quantized operator, which would mean that it's designed to store any quantization information in attrs. This function may modify calib_attrs.input_quant to direct quantization to supply different inputs to this operator. The quantization algorithm will insert quantize or dequantize nodes so that the inputs have the type and quantization that were assigned. An exception will be raised if the input can't be provided by inserting a quantize or dequantize node or leaving the input unchanged. The quantized operator attributes are returned. :param attrs: Floating-point operator attributes. :param quantizer_interface: Quantization-related properties of a node's interface before and after quantization, for use when quantizing the node. :param config: Parameters controlling how to quantize. :param error_reporter: Node reporter of the node to be quantized. :returns: Quantized operator attributes. .. py:method:: run_quant(quant_attrs: afe.ir.attributes.PReluQuantAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.np.ndarray], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Execute the operation using quantized arithmetic. :param quant_attrs: Parameters that define the quantized operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:class:: BroadcastToOp An abstract class Stores a list of input key names expected to be passed in by the AwesomeNode for developer reference. .. attribute:: input_list ClassVar[Optional[List[InputName]]]. Used as reference when getting inputs from a dictionary. If input_list is None, AFE will skip validating input_list at runtime .. attribute:: observer_behavior How observers are used in a node during calibration .. py:attribute:: input_list :type: ClassVar[afe.ir.attributes.List[afe.ir.defines.InputName]] .. py:attribute:: observer_behavior :type: ClassVar[ObserverBehavior] .. py:attribute:: broadcast_to_fn .. py:method:: get_type(attrs: afe.ir.attributes.BroadcastToAttrs | afe.ir.attributes.BroadcastToQuantAttrs) -> afe.ir.tensor_type.NodeType :classmethod: Get the type of this node given its attributes. The parameter should be a QUANT_ATTRS if that data has been created, or an AWESOME_ATTRIBUTES otherwise. :param attrs: Attributes associated with the operator. It is an AWESOME_ATTRIBUTES if quantization has not transformed the node, or a QUANT_ATTRS if it has. :return: The node's type. .. py:method:: run(attrs: afe.ir.attributes.BroadcastToAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.np.ndarray], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Executes the operation in floating point :param attrs: AwesomeAttributes associated with this operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:method:: quantize(attrs: afe.ir.attributes.BroadcastToAttrs, quantizer_interface: afe.ir.quantization_interface.OpQuantInterface, config: afe.core.configs.QuantizationConfigs, error_reporter: afe.ir.defines.NodeReporter) -> afe.ir.attributes.BroadcastToAttrs | afe.ir.attributes.BroadcastToQuantAttrs :classmethod: Compute quantized operator attributes, input quantization, and output quantization from floating-point operator attributes and the result of calibration. When this function is called, calib_attrs.input_quant has the types and quantization of the input values (after the inputs have been transformed by quantization), and calib_attrs.quant holds a type and quantization of the output, which this function may overwrite. The output quantization is computed based on calibration. The output type should not be used. This function must assign to calib_attrs.quant the output type and quantization that this operator has after quantization. It may use the default quantization if appropriate. This function may modify attrs. It should modify attrs if the same attribute class is used for both the floating-point and the quantized operator, which would mean that it's designed to store any quantization information in attrs. This function may modify calib_attrs.input_quant to direct quantization to supply different inputs to this operator. The quantization algorithm will insert quantize or dequantize nodes so that the inputs have the type and quantization that were assigned. An exception will be raised if the input can't be provided by inserting a quantize or dequantize node or leaving the input unchanged. The quantized operator attributes are returned. :param attrs: Floating-point operator attributes. :param quantizer_interface: Quantization-related properties of a node's interface before and after quantization, for use when quantizing the node. :param config: Parameters controlling how to quantize. :param error_reporter: Node reporter of the node to be quantized. :returns: Quantized operator attributes. .. py:method:: run_quant(attrs: afe.ir.attributes.BroadcastToQuantAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.np.ndarray], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Execute the operation using quantized arithmetic. :param quant_attrs: Parameters that define the quantized operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:class:: UDFOp An abstract class Stores a list of input key names expected to be passed in by the AwesomeNode for developer reference. .. attribute:: input_list ClassVar[Optional[List[InputName]]]. Used as reference when getting inputs from a dictionary. If input_list is None, AFE will skip validating input_list at runtime .. attribute:: observer_behavior How observers are used in a node during calibration .. py:attribute:: input_list :type: ClassVar[afe.ir.attributes.List[afe.ir.defines.InputName]] .. py:attribute:: observer_behavior :type: ClassVar[ObserverBehavior] .. py:attribute:: has_bf16_support :type: ClassVar[bool] :value: False .. py:attribute:: udf_fn :type: afe.ir.attributes.Optional[Callable[[afe.ir.attributes.np.ndarray], afe.ir.attributes.np.ndarray]] :value: None .. py:method:: get_type(attrs: afe.ir.attributes.Union[afe.ir.attributes.UDFAttrs, afe.ir.attributes.UDFQuantAttrs]) -> afe.ir.tensor_type.NodeType :classmethod: Get the type of this node given its attributes. The parameter should be a QUANT_ATTRS if that data has been created, or an AWESOME_ATTRIBUTES otherwise. :param attrs: Attributes associated with the operator. It is an AWESOME_ATTRIBUTES if quantization has not transformed the node, or a QUANT_ATTRS if it has. :return: The node's type. .. py:method:: run(attrs: afe.ir.attributes.UDFAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.np.ndarray], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Executes the operation in floating point :param attrs: AwesomeAttributes associated with this operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:method:: quantize(attrs: afe.ir.attributes.UDFAttrs, quantizer_interface: afe.ir.quantization_interface.OpQuantInterface, config: afe.core.configs.QuantizationConfigs, error_reporter: afe.ir.defines.NodeReporter) -> afe.ir.attributes.Union[afe.ir.attributes.UDFAttrs, afe.ir.attributes.UDFQuantAttrs] :classmethod: Compute quantized operator attributes, input quantization, and output quantization from floating-point operator attributes and the result of calibration. When this function is called, calib_attrs.input_quant has the types and quantization of the input values (after the inputs have been transformed by quantization), and calib_attrs.quant holds a type and quantization of the output, which this function may overwrite. The output quantization is computed based on calibration. The output type should not be used. This function must assign to calib_attrs.quant the output type and quantization that this operator has after quantization. It may use the default quantization if appropriate. This function may modify attrs. It should modify attrs if the same attribute class is used for both the floating-point and the quantized operator, which would mean that it's designed to store any quantization information in attrs. This function may modify calib_attrs.input_quant to direct quantization to supply different inputs to this operator. The quantization algorithm will insert quantize or dequantize nodes so that the inputs have the type and quantization that were assigned. An exception will be raised if the input can't be provided by inserting a quantize or dequantize node or leaving the input unchanged. The quantized operator attributes are returned. :param attrs: Floating-point operator attributes. :param quantizer_interface: Quantization-related properties of a node's interface before and after quantization, for use when quantizing the node. :param config: Parameters controlling how to quantize. :param error_reporter: Node reporter of the node to be quantized. :returns: Quantized operator attributes. .. py:method:: run_quant(quant_attrs: afe.ir.attributes.UDFQuantAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.np.ndarray], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Execute the operation using quantized arithmetic. :param quant_attrs: Parameters that define the quantized operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:class:: SqrtOp An abstract class Stores a list of input key names expected to be passed in by the AwesomeNode for developer reference. .. attribute:: input_list ClassVar[Optional[List[InputName]]]. Used as reference when getting inputs from a dictionary. If input_list is None, AFE will skip validating input_list at runtime .. attribute:: observer_behavior How observers are used in a node during calibration .. py:attribute:: has_bf16_support :type: ClassVar[bool] :value: False .. py:attribute:: udf_fn :type: Callable[[afe.ir.attributes.np.ndarray], afe.ir.attributes.np.ndarray] .. py:class:: RsqrtOp An abstract class Stores a list of input key names expected to be passed in by the AwesomeNode for developer reference. .. attribute:: input_list ClassVar[Optional[List[InputName]]]. Used as reference when getting inputs from a dictionary. If input_list is None, AFE will skip validating input_list at runtime .. attribute:: observer_behavior How observers are used in a node during calibration .. py:attribute:: has_bf16_support :type: ClassVar[bool] :value: False .. py:attribute:: udf_fn :type: Callable[[afe.ir.attributes.np.ndarray], afe.ir.attributes.np.ndarray] .. py:class:: TanhOp An abstract class Stores a list of input key names expected to be passed in by the AwesomeNode for developer reference. .. attribute:: input_list ClassVar[Optional[List[InputName]]]. Used as reference when getting inputs from a dictionary. If input_list is None, AFE will skip validating input_list at runtime .. attribute:: observer_behavior How observers are used in a node during calibration .. py:attribute:: has_bf16_support :type: ClassVar[bool] :value: True .. py:attribute:: udf_fn :type: Callable[[afe.ir.attributes.np.ndarray], afe.ir.attributes.np.ndarray] .. py:class:: SigmoidOp An abstract class Stores a list of input key names expected to be passed in by the AwesomeNode for developer reference. .. attribute:: input_list ClassVar[Optional[List[InputName]]]. Used as reference when getting inputs from a dictionary. If input_list is None, AFE will skip validating input_list at runtime .. attribute:: observer_behavior How observers are used in a node during calibration .. py:attribute:: has_bf16_support :type: ClassVar[bool] :value: True .. py:attribute:: udf_fn :type: Callable[[afe.ir.attributes.np.ndarray, afe.ir.operation_functions.RunMode], afe.ir.attributes.np.ndarray] .. py:method:: run(attrs: afe.ir.attributes.UDFAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.np.ndarray], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Executes the operation in floating point :param attrs: AwesomeAttributes associated with this operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:class:: LogOp An abstract class Stores a list of input key names expected to be passed in by the AwesomeNode for developer reference. .. attribute:: input_list ClassVar[Optional[List[InputName]]]. Used as reference when getting inputs from a dictionary. If input_list is None, AFE will skip validating input_list at runtime .. attribute:: observer_behavior How observers are used in a node during calibration .. py:attribute:: has_bf16_support :type: ClassVar[bool] :value: False .. py:attribute:: udf_fn :type: Callable[[afe.ir.attributes.np.ndarray], afe.ir.attributes.np.ndarray] .. py:class:: Log2Op An abstract class Stores a list of input key names expected to be passed in by the AwesomeNode for developer reference. .. attribute:: input_list ClassVar[Optional[List[InputName]]]. Used as reference when getting inputs from a dictionary. If input_list is None, AFE will skip validating input_list at runtime .. attribute:: observer_behavior How observers are used in a node during calibration .. py:attribute:: has_bf16_support :type: ClassVar[bool] :value: False .. py:attribute:: udf_fn :type: Callable[[afe.ir.attributes.np.ndarray], afe.ir.attributes.np.ndarray] .. py:class:: Log10Op An abstract class Stores a list of input key names expected to be passed in by the AwesomeNode for developer reference. .. attribute:: input_list ClassVar[Optional[List[InputName]]]. Used as reference when getting inputs from a dictionary. If input_list is None, AFE will skip validating input_list at runtime .. attribute:: observer_behavior How observers are used in a node during calibration .. py:attribute:: has_bf16_support :type: ClassVar[bool] :value: False .. py:attribute:: udf_fn :type: Callable[[afe.ir.attributes.np.ndarray], afe.ir.attributes.np.ndarray] .. py:class:: ReciprocalOp An abstract class Stores a list of input key names expected to be passed in by the AwesomeNode for developer reference. .. attribute:: input_list ClassVar[Optional[List[InputName]]]. Used as reference when getting inputs from a dictionary. If input_list is None, AFE will skip validating input_list at runtime .. attribute:: observer_behavior How observers are used in a node during calibration .. py:attribute:: has_bf16_support :type: ClassVar[bool] :value: True .. py:attribute:: udf_fn :type: Callable[[afe.ir.attributes.np.ndarray], afe.ir.attributes.np.ndarray] .. py:class:: EluOp An abstract class Stores a list of input key names expected to be passed in by the AwesomeNode for developer reference. .. attribute:: input_list ClassVar[Optional[List[InputName]]]. Used as reference when getting inputs from a dictionary. If input_list is None, AFE will skip validating input_list at runtime .. attribute:: observer_behavior How observers are used in a node during calibration .. py:attribute:: has_bf16_support :type: ClassVar[bool] :value: True .. py:attribute:: udf_fn :type: Callable[[afe.ir.attributes.np.ndarray], afe.ir.attributes.np.ndarray] .. py:class:: SoftplusOp An abstract class Stores a list of input key names expected to be passed in by the AwesomeNode for developer reference. .. attribute:: input_list ClassVar[Optional[List[InputName]]]. Used as reference when getting inputs from a dictionary. If input_list is None, AFE will skip validating input_list at runtime .. attribute:: observer_behavior How observers are used in a node during calibration .. py:attribute:: has_bf16_support :type: ClassVar[bool] :value: True .. py:attribute:: udf_fn :type: Callable[[afe.ir.attributes.np.ndarray], afe.ir.attributes.np.ndarray] .. py:class:: ErfOp An abstract class Stores a list of input key names expected to be passed in by the AwesomeNode for developer reference. .. attribute:: input_list ClassVar[Optional[List[InputName]]]. Used as reference when getting inputs from a dictionary. If input_list is None, AFE will skip validating input_list at runtime .. attribute:: observer_behavior How observers are used in a node during calibration .. py:attribute:: has_bf16_support :type: ClassVar[bool] :value: True .. py:attribute:: udf_fn :type: Callable[[afe.ir.attributes.np.ndarray], afe.ir.attributes.np.ndarray] .. py:class:: GeluOp An abstract class Stores a list of input key names expected to be passed in by the AwesomeNode for developer reference. .. attribute:: input_list ClassVar[Optional[List[InputName]]]. Used as reference when getting inputs from a dictionary. If input_list is None, AFE will skip validating input_list at runtime .. attribute:: observer_behavior How observers are used in a node during calibration .. py:attribute:: has_bf16_support :type: ClassVar[bool] :value: False .. py:attribute:: udf_fn :type: Callable[[afe.ir.attributes.np.ndarray], afe.ir.attributes.np.ndarray] .. py:class:: DivideOp An abstract class Stores a list of input key names expected to be passed in by the AwesomeNode for developer reference. .. attribute:: input_list ClassVar[Optional[List[InputName]]]. Used as reference when getting inputs from a dictionary. If input_list is None, AFE will skip validating input_list at runtime .. attribute:: observer_behavior How observers are used in a node during calibration .. py:attribute:: input_list :type: ClassVar[afe.ir.attributes.List[afe.ir.defines.InputName]] .. py:attribute:: observer_behavior :type: ClassVar[ObserverBehavior] .. py:attribute:: divide_fn :type: Callable[[afe.ir.attributes.np.ndarray, afe.ir.attributes.np.ndarray], afe.ir.attributes.np.ndarray] .. py:attribute:: reciprocal_op :type: ReciprocalOp .. py:attribute:: multiply_op :type: MultiplyOp .. py:method:: get_type(attrs: afe.ir.attributes.Union[afe.ir.attributes.DivideAttrs, afe.ir.attributes.DivideQuantAttrs]) -> afe.ir.tensor_type.NodeType :classmethod: Get the type of this node given its attributes. The parameter should be a QUANT_ATTRS if that data has been created, or an AWESOME_ATTRIBUTES otherwise. :param attrs: Attributes associated with the operator. It is an AWESOME_ATTRIBUTES if quantization has not transformed the node, or a QUANT_ATTRS if it has. :return: The node's type. .. py:method:: run(attrs: afe.ir.attributes.AwesomeAttributes, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.np.ndarray], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Executes the operation in floating point :param attrs: AwesomeAttributes associated with this operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:method:: calibrate(attrs: AWESOME_ATTRS, calib_attrs: afe.ir.attributes.AwesomeCalibAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.Any], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.Any :classmethod: DivideOp calibration method. Executes default calibration to get results of Divide operation in floating point. Additionally, calculate intermediate results for reciprocal(rhs) and update the observer for intermediate values. :param attrs: AwesomeAttributes associated with this operation :param calib_attrs: AwesomeCalibAttrs associated with operation's node. :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Parameters controlling how to calibrate. :return: Output tensor(s) whose type is dependent on the subclass. .. py:method:: quantize(attrs: afe.ir.attributes.DivideAttrs, quantizer_interface: afe.ir.quantization_interface.OpQuantInterface, config: afe.core.configs.QuantizationConfigs, error_reporter: afe.ir.defines.NodeReporter) -> afe.ir.attributes.DivideQuantAttrs :classmethod: Compute quantized operator attributes, input quantization, and output quantization from floating-point operator attributes and the result of calibration. When this function is called, calib_attrs.input_quant has the types and quantization of the input values (after the inputs have been transformed by quantization), and calib_attrs.quant holds a type and quantization of the output, which this function may overwrite. The output quantization is computed based on calibration. The output type should not be used. This function must assign to calib_attrs.quant the output type and quantization that this operator has after quantization. It may use the default quantization if appropriate. This function may modify attrs. It should modify attrs if the same attribute class is used for both the floating-point and the quantized operator, which would mean that it's designed to store any quantization information in attrs. This function may modify calib_attrs.input_quant to direct quantization to supply different inputs to this operator. The quantization algorithm will insert quantize or dequantize nodes so that the inputs have the type and quantization that were assigned. An exception will be raised if the input can't be provided by inserting a quantize or dequantize node or leaving the input unchanged. The quantized operator attributes are returned. :param attrs: Floating-point operator attributes. :param quantizer_interface: Quantization-related properties of a node's interface before and after quantization, for use when quantizing the node. :param config: Parameters controlling how to quantize. :param error_reporter: Node reporter of the node to be quantized. :returns: Quantized operator attributes. .. py:method:: run_quant(quant_attrs: afe.ir.attributes.DivideQuantAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.Any], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Execute the operation using quantized arithmetic. :param quant_attrs: Parameters that define the quantized operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:class:: ExpOp An abstract class Stores a list of input key names expected to be passed in by the AwesomeNode for developer reference. .. attribute:: input_list ClassVar[Optional[List[InputName]]]. Used as reference when getting inputs from a dictionary. If input_list is None, AFE will skip validating input_list at runtime .. attribute:: observer_behavior How observers are used in a node during calibration .. py:attribute:: has_bf16_support :type: ClassVar[bool] :value: True .. py:attribute:: udf_fn :type: Callable[[afe.ir.attributes.np.ndarray], afe.ir.attributes.np.ndarray] .. py:class:: SwishOp An abstract class Stores a list of input key names expected to be passed in by the AwesomeNode for developer reference. .. attribute:: input_list ClassVar[Optional[List[InputName]]]. Used as reference when getting inputs from a dictionary. If input_list is None, AFE will skip validating input_list at runtime .. attribute:: observer_behavior How observers are used in a node during calibration .. py:attribute:: has_bf16_support :type: ClassVar[bool] :value: True .. py:attribute:: udf_fn :type: Callable[[afe.ir.attributes.np.ndarray], afe.ir.attributes.np.ndarray] .. py:class:: QuickGeluOp An abstract class Stores a list of input key names expected to be passed in by the AwesomeNode for developer reference. .. attribute:: input_list ClassVar[Optional[List[InputName]]]. Used as reference when getting inputs from a dictionary. If input_list is None, AFE will skip validating input_list at runtime .. attribute:: observer_behavior How observers are used in a node during calibration .. py:attribute:: has_bf16_support :type: ClassVar[bool] :value: True .. py:attribute:: udf_fn :type: Callable[[afe.ir.attributes.np.ndarray], afe.ir.attributes.np.ndarray] .. py:class:: HardSwishOp An abstract class Stores a list of input key names expected to be passed in by the AwesomeNode for developer reference. .. attribute:: input_list ClassVar[Optional[List[InputName]]]. Used as reference when getting inputs from a dictionary. If input_list is None, AFE will skip validating input_list at runtime .. attribute:: observer_behavior How observers are used in a node during calibration .. py:attribute:: has_bf16_support :type: ClassVar[bool] :value: True .. py:attribute:: udf_fn :type: Callable[[afe.ir.attributes.np.ndarray], afe.ir.attributes.np.ndarray] .. py:class:: UpsamplingOp An abstract class Stores a list of input key names expected to be passed in by the AwesomeNode for developer reference. .. attribute:: input_list ClassVar[Optional[List[InputName]]]. Used as reference when getting inputs from a dictionary. If input_list is None, AFE will skip validating input_list at runtime .. attribute:: observer_behavior How observers are used in a node during calibration .. py:attribute:: input_list :type: ClassVar[afe.ir.attributes.List[afe.ir.defines.InputName]] .. py:attribute:: observer_behavior :type: ClassVar[ObserverBehavior] .. py:attribute:: upsampling_fn :type: Callable[[afe.ir.attributes.np.ndarray], afe.ir.attributes.np.ndarray] .. py:method:: get_type(attrs: afe.ir.attributes.Union[afe.ir.attributes.UpsamplingAttrs, afe.ir.attributes.UpsamplingQuantAttrs]) -> afe.ir.tensor_type.NodeType :classmethod: Get the type of this node given its attributes. The parameter should be a QUANT_ATTRS if that data has been created, or an AWESOME_ATTRIBUTES otherwise. :param attrs: Attributes associated with the operator. It is an AWESOME_ATTRIBUTES if quantization has not transformed the node, or a QUANT_ATTRS if it has. :return: The node's type. .. py:method:: run(attrs: afe.ir.attributes.UpsamplingAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.np.ndarray], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Executes the operation in floating point :param attrs: AwesomeAttributes associated with this operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:method:: quantize(attrs: afe.ir.attributes.UpsamplingAttrs, quantizer_interface: afe.ir.quantization_interface.OpQuantInterface, config: afe.core.configs.QuantizationConfigs, error_reporter: afe.ir.defines.NodeReporter) -> afe.ir.attributes.Union[afe.ir.attributes.UpsamplingAttrs, afe.ir.attributes.UpsamplingQuantAttrs] :classmethod: Compute quantized operator attributes, input quantization, and output quantization from floating-point operator attributes and the result of calibration. When this function is called, calib_attrs.input_quant has the types and quantization of the input values (after the inputs have been transformed by quantization), and calib_attrs.quant holds a type and quantization of the output, which this function may overwrite. The output quantization is computed based on calibration. The output type should not be used. This function must assign to calib_attrs.quant the output type and quantization that this operator has after quantization. It may use the default quantization if appropriate. This function may modify attrs. It should modify attrs if the same attribute class is used for both the floating-point and the quantized operator, which would mean that it's designed to store any quantization information in attrs. This function may modify calib_attrs.input_quant to direct quantization to supply different inputs to this operator. The quantization algorithm will insert quantize or dequantize nodes so that the inputs have the type and quantization that were assigned. An exception will be raised if the input can't be provided by inserting a quantize or dequantize node or leaving the input unchanged. The quantized operator attributes are returned. :param attrs: Floating-point operator attributes. :param quantizer_interface: Quantization-related properties of a node's interface before and after quantization, for use when quantizing the node. :param config: Parameters controlling how to quantize. :param error_reporter: Node reporter of the node to be quantized. :returns: Quantized operator attributes. .. py:method:: run_quant(quant_attrs: afe.ir.attributes.UpsamplingQuantAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.np.ndarray], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Execute the operation using quantized arithmetic. :param quant_attrs: Parameters that define the quantized operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:class:: ImageResize2DOp An abstract class Stores a list of input key names expected to be passed in by the AwesomeNode for developer reference. .. attribute:: input_list ClassVar[Optional[List[InputName]]]. Used as reference when getting inputs from a dictionary. If input_list is None, AFE will skip validating input_list at runtime .. attribute:: observer_behavior How observers are used in a node during calibration .. py:attribute:: input_list :type: ClassVar[afe.ir.attributes.List[afe.ir.defines.InputName]] .. py:attribute:: observer_behavior :type: ClassVar[ObserverBehavior] .. py:attribute:: image_resize_fn :type: Callable[[afe.ir.attributes.ImageResize2DAttrs, afe.ir.attributes.np.ndarray], afe.ir.attributes.np.ndarray] .. py:method:: get_type(attrs: afe.ir.attributes.Union[afe.ir.attributes.ImageResize2DAttrs, afe.ir.attributes.ImageResize2DQuantAttrs]) -> afe.ir.tensor_type.NodeType :classmethod: Get the type of this node given its attributes. The parameter should be a QUANT_ATTRS if that data has been created, or an AWESOME_ATTRIBUTES otherwise. :param attrs: Attributes associated with the operator. It is an AWESOME_ATTRIBUTES if quantization has not transformed the node, or a QUANT_ATTRS if it has. :return: The node's type. .. py:method:: run(attrs: afe.ir.attributes.ImageResize2DAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.np.ndarray], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Executes the operation in floating point :param attrs: AwesomeAttributes associated with this operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:method:: quantize(attrs: afe.ir.attributes.ImageResize2DAttrs, quantizer_interface: afe.ir.quantization_interface.OpQuantInterface, config: afe.core.configs.QuantizationConfigs, error_reporter: afe.ir.defines.NodeReporter) -> afe.ir.attributes.Union[afe.ir.attributes.ImageResize2DAttrs, afe.ir.attributes.ImageResize2DQuantAttrs] :classmethod: In MLA implementation of resize, output type is the same as input type. There is no intermediate int32 result. Always use int8, if integer scaling factor != (1, 2, 4). int8 True int8 int8 int8 int8 False int8 int8 int8 int16 False int8 int8 int8 int16 True int16 int16 int16 .. py:method:: run_quant(quant_attrs: afe.ir.attributes.ImageResize2DQuantAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.np.ndarray], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Execute the operation using quantized arithmetic. :param quant_attrs: Parameters that define the quantized operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:class:: GridSampleOp An abstract class Stores a list of input key names expected to be passed in by the AwesomeNode for developer reference. .. attribute:: input_list ClassVar[Optional[List[InputName]]]. Used as reference when getting inputs from a dictionary. If input_list is None, AFE will skip validating input_list at runtime .. attribute:: observer_behavior How observers are used in a node during calibration .. py:attribute:: input_list :type: ClassVar[afe.ir.attributes.List[afe.ir.defines.InputName]] .. py:attribute:: observer_behavior :type: ClassVar[ObserverBehavior] .. py:attribute:: gridsample_fn :type: Callable[[afe.ir.attributes.GridSampleAttrs, afe.ir.attributes.np.ndarray, afe.ir.attributes.np.ndarray], afe.ir.attributes.np.ndarray] .. py:method:: get_type(attrs: afe.ir.attributes.GridSampleAttrs) -> afe.ir.tensor_type.NodeType :classmethod: Get the type of this node given its attributes. The parameter should be a QUANT_ATTRS if that data has been created, or an AWESOME_ATTRIBUTES otherwise. :param attrs: Attributes associated with the operator. It is an AWESOME_ATTRIBUTES if quantization has not transformed the node, or a QUANT_ATTRS if it has. :return: The node's type. .. py:method:: run(attrs: afe.ir.attributes.GridSampleAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.np.ndarray], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Executes the operation in floating point :param attrs: AwesomeAttributes associated with this operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:method:: quantize(attrs: afe.ir.attributes.GridSampleAttrs, quantizer_interface: afe.ir.quantization_interface.OpQuantInterface, config: afe.core.configs.QuantizationConfigs, error_reporter: afe.ir.defines.NodeReporter) -> afe.ir.attributes.GridSampleAttrs :classmethod: Compute quantized operator attributes, input quantization, and output quantization from floating-point operator attributes and the result of calibration. When this function is called, calib_attrs.input_quant has the types and quantization of the input values (after the inputs have been transformed by quantization), and calib_attrs.quant holds a type and quantization of the output, which this function may overwrite. The output quantization is computed based on calibration. The output type should not be used. This function must assign to calib_attrs.quant the output type and quantization that this operator has after quantization. It may use the default quantization if appropriate. This function may modify attrs. It should modify attrs if the same attribute class is used for both the floating-point and the quantized operator, which would mean that it's designed to store any quantization information in attrs. This function may modify calib_attrs.input_quant to direct quantization to supply different inputs to this operator. The quantization algorithm will insert quantize or dequantize nodes so that the inputs have the type and quantization that were assigned. An exception will be raised if the input can't be provided by inserting a quantize or dequantize node or leaving the input unchanged. The quantized operator attributes are returned. :param attrs: Floating-point operator attributes. :param quantizer_interface: Quantization-related properties of a node's interface before and after quantization, for use when quantizing the node. :param config: Parameters controlling how to quantize. :param error_reporter: Node reporter of the node to be quantized. :returns: Quantized operator attributes. .. py:class:: TupleOp TupleOp takes in multiple tensors, returns a tuple .. py:attribute:: input_list :value: None .. py:attribute:: observer_behavior :type: ClassVar[ObserverBehavior] .. py:attribute:: tuple_fn :type: Callable[[afe.ir.attributes.List[afe.ir.attributes.np.ndarray]], tuple] .. py:method:: get_type(attrs: afe.ir.attributes.TupleAttrs) -> afe.ir.tensor_type.NodeType :classmethod: Get the type of this node given its attributes. The parameter should be a QUANT_ATTRS if that data has been created, or an AWESOME_ATTRIBUTES otherwise. :param attrs: Attributes associated with the operator. It is an AWESOME_ATTRIBUTES if quantization has not transformed the node, or a QUANT_ATTRS if it has. :return: The node's type. .. py:method:: run(_: afe.ir.attributes.TupleAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.np.ndarray], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.Tuple[afe.ir.attributes.np.ndarray, Ellipsis] :classmethod: Executes the operation in floating point :param attrs: AwesomeAttributes associated with this operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:method:: quantize(attrs: afe.ir.attributes.TupleAttrs, quantizer_interface: afe.ir.quantization_interface.OpQuantInterface, config: afe.core.configs.QuantizationConfigs, error_reporter: afe.ir.defines.NodeReporter) -> afe.ir.attributes.TupleAttrs :classmethod: Compute quantized operator attributes, input quantization, and output quantization from floating-point operator attributes and the result of calibration. When this function is called, calib_attrs.input_quant has the types and quantization of the input values (after the inputs have been transformed by quantization), and calib_attrs.quant holds a type and quantization of the output, which this function may overwrite. The output quantization is computed based on calibration. The output type should not be used. This function must assign to calib_attrs.quant the output type and quantization that this operator has after quantization. It may use the default quantization if appropriate. This function may modify attrs. It should modify attrs if the same attribute class is used for both the floating-point and the quantized operator, which would mean that it's designed to store any quantization information in attrs. This function may modify calib_attrs.input_quant to direct quantization to supply different inputs to this operator. The quantization algorithm will insert quantize or dequantize nodes so that the inputs have the type and quantization that were assigned. An exception will be raised if the input can't be provided by inserting a quantize or dequantize node or leaving the input unchanged. The quantized operator attributes are returned. :param attrs: Floating-point operator attributes. :param quantizer_interface: Quantization-related properties of a node's interface before and after quantization, for use when quantizing the node. :param config: Parameters controlling how to quantize. :param error_reporter: Node reporter of the node to be quantized. :returns: Quantized operator attributes. .. py:class:: TupleGetItemOp TupleGetItemOp takes in a tuple, returns a tensor .. py:attribute:: input_list :type: ClassVar[afe.ir.attributes.List[afe.ir.defines.InputName]] .. py:attribute:: observer_behavior :type: ClassVar[ObserverBehavior] .. py:attribute:: tuple_get_item_fn :type: Callable[[afe.ir.attributes.TupleGetItemAttrs, tuple], afe.ir.attributes.np.ndarray] .. py:method:: get_type(attrs: afe.ir.attributes.TupleGetItemAttrs) -> afe.ir.tensor_type.NodeType :classmethod: Get the type of this node given its attributes. The parameter should be a QUANT_ATTRS if that data has been created, or an AWESOME_ATTRIBUTES otherwise. :param attrs: Attributes associated with the operator. It is an AWESOME_ATTRIBUTES if quantization has not transformed the node, or a QUANT_ATTRS if it has. :return: The node's type. .. py:method:: run(attrs: afe.ir.attributes.TupleGetItemAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, tuple], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Executes the operation in floating point :param attrs: AwesomeAttributes associated with this operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:method:: quantize(attrs: afe.ir.attributes.TupleGetItemAttrs, quantizer_interface: afe.ir.quantization_interface.OpQuantInterface, config: afe.core.configs.QuantizationConfigs, error_reporter: afe.ir.defines.NodeReporter) -> afe.ir.attributes.TupleGetItemAttrs :classmethod: Compute quantized operator attributes, input quantization, and output quantization from floating-point operator attributes and the result of calibration. When this function is called, calib_attrs.input_quant has the types and quantization of the input values (after the inputs have been transformed by quantization), and calib_attrs.quant holds a type and quantization of the output, which this function may overwrite. The output quantization is computed based on calibration. The output type should not be used. This function must assign to calib_attrs.quant the output type and quantization that this operator has after quantization. It may use the default quantization if appropriate. This function may modify attrs. It should modify attrs if the same attribute class is used for both the floating-point and the quantized operator, which would mean that it's designed to store any quantization information in attrs. This function may modify calib_attrs.input_quant to direct quantization to supply different inputs to this operator. The quantization algorithm will insert quantize or dequantize nodes so that the inputs have the type and quantization that were assigned. An exception will be raised if the input can't be provided by inserting a quantize or dequantize node or leaving the input unchanged. The quantized operator attributes are returned. :param attrs: Floating-point operator attributes. :param quantizer_interface: Quantization-related properties of a node's interface before and after quantization, for use when quantizing the node. :param config: Parameters controlling how to quantize. :param error_reporter: Node reporter of the node to be quantized. :returns: Quantized operator attributes. .. py:class:: SqueezeOp An abstract class Stores a list of input key names expected to be passed in by the AwesomeNode for developer reference. .. attribute:: input_list ClassVar[Optional[List[InputName]]]. Used as reference when getting inputs from a dictionary. If input_list is None, AFE will skip validating input_list at runtime .. attribute:: observer_behavior How observers are used in a node during calibration .. py:attribute:: input_list :type: ClassVar[afe.ir.attributes.List[afe.ir.defines.InputName]] .. py:attribute:: observer_behavior :type: ClassVar[ObserverBehavior] .. py:attribute:: squeeze_fn :type: Callable[[afe.ir.attributes.SqueezeAttrs, afe.ir.attributes.np.ndarray], afe.ir.attributes.np.ndarray] .. py:method:: get_type(attrs: afe.ir.attributes.Union[afe.ir.attributes.SqueezeAttrs, QUANT_ATTRS]) -> afe.ir.tensor_type.NodeType :classmethod: Get the type of this node given its attributes. The parameter should be a QUANT_ATTRS if that data has been created, or an AWESOME_ATTRIBUTES otherwise. :param attrs: Attributes associated with the operator. It is an AWESOME_ATTRIBUTES if quantization has not transformed the node, or a QUANT_ATTRS if it has. :return: The node's type. .. py:method:: run(attrs: afe.ir.attributes.SqueezeAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.np.ndarray], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Executes the operation in floating point :param attrs: AwesomeAttributes associated with this operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:class:: ConcatenateOp An abstract class Stores a list of input key names expected to be passed in by the AwesomeNode for developer reference. .. attribute:: input_list ClassVar[Optional[List[InputName]]]. Used as reference when getting inputs from a dictionary. If input_list is None, AFE will skip validating input_list at runtime .. attribute:: observer_behavior How observers are used in a node during calibration .. py:attribute:: input_list :type: ClassVar[afe.ir.attributes.List[afe.ir.defines.InputName]] :value: None .. py:attribute:: observer_behavior :type: ClassVar[ObserverBehavior] .. py:method:: get_type(attrs: afe.ir.attributes.Union[afe.ir.attributes.ConcatenateAttrs, afe.ir.attributes.ConcatQuantAttrs]) -> afe.ir.tensor_type.NodeType :classmethod: Get the type of this node given its attributes. The parameter should be a QUANT_ATTRS if that data has been created, or an AWESOME_ATTRIBUTES otherwise. :param attrs: Attributes associated with the operator. It is an AWESOME_ATTRIBUTES if quantization has not transformed the node, or a QUANT_ATTRS if it has. :return: The node's type. .. py:method:: run(attrs: afe.ir.attributes.ConcatenateAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.np.ndarray], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Executes the operation in floating point :param attrs: AwesomeAttributes associated with this operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:method:: quantize(attrs: afe.ir.attributes.ConcatenateAttrs, quantizer_interface: afe.ir.quantization_interface.OpQuantInterface, config: afe.core.configs.QuantizationConfigs, error_reporter: afe.ir.defines.NodeReporter) -> afe.ir.attributes.Union[afe.ir.attributes.ConcatenateAttrs, afe.ir.attributes.ConcatQuantAttrs] :classmethod: Compute quantized operator attributes, input quantization, and output quantization from floating-point operator attributes and the result of calibration. When this function is called, calib_attrs.input_quant has the types and quantization of the input values (after the inputs have been transformed by quantization), and calib_attrs.quant holds a type and quantization of the output, which this function may overwrite. The output quantization is computed based on calibration. The output type should not be used. This function must assign to calib_attrs.quant the output type and quantization that this operator has after quantization. It may use the default quantization if appropriate. This function may modify attrs. It should modify attrs if the same attribute class is used for both the floating-point and the quantized operator, which would mean that it's designed to store any quantization information in attrs. This function may modify calib_attrs.input_quant to direct quantization to supply different inputs to this operator. The quantization algorithm will insert quantize or dequantize nodes so that the inputs have the type and quantization that were assigned. An exception will be raised if the input can't be provided by inserting a quantize or dequantize node or leaving the input unchanged. The quantized operator attributes are returned. :param attrs: Floating-point operator attributes. :param quantizer_interface: Quantization-related properties of a node's interface before and after quantization, for use when quantizing the node. :param config: Parameters controlling how to quantize. :param error_reporter: Node reporter of the node to be quantized. :returns: Quantized operator attributes. .. py:method:: run_quant(quant_attrs: afe.ir.attributes.ConcatQuantAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.np.ndarray], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Execute the operation using quantized arithmetic. :param quant_attrs: Parameters that define the quantized operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:class:: TransposeOp An abstract class Stores a list of input key names expected to be passed in by the AwesomeNode for developer reference. .. attribute:: input_list ClassVar[Optional[List[InputName]]]. Used as reference when getting inputs from a dictionary. If input_list is None, AFE will skip validating input_list at runtime .. attribute:: observer_behavior How observers are used in a node during calibration .. py:attribute:: input_list :type: ClassVar[afe.ir.attributes.List[afe.ir.defines.InputName]] .. py:attribute:: observer_behavior :type: ClassVar[ObserverBehavior] .. py:attribute:: transpose_fn :type: Callable[[afe.ir.attributes.TransposeAttrs, afe.ir.attributes.np.ndarray], afe.ir.attributes.np.ndarray] .. py:method:: get_type(attrs: afe.ir.attributes.Union[afe.ir.attributes.TransposeAttrs, QUANT_ATTRS]) -> afe.ir.tensor_type.NodeType :classmethod: Get the type of this node given its attributes. The parameter should be a QUANT_ATTRS if that data has been created, or an AWESOME_ATTRIBUTES otherwise. :param attrs: Attributes associated with the operator. It is an AWESOME_ATTRIBUTES if quantization has not transformed the node, or a QUANT_ATTRS if it has. :return: The node's type. .. py:method:: run(attrs: afe.ir.attributes.TransposeAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.np.ndarray], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Executes the operation in floating point :param attrs: AwesomeAttributes associated with this operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:method:: quantize(attrs: afe.ir.attributes.TransposeAttrs, quantizer_interface: afe.ir.quantization_interface.OpQuantInterface, config: afe.core.configs.QuantizationConfigs, error_reporter: afe.ir.defines.NodeReporter) -> afe.ir.attributes.TransposeAttrs :classmethod: Compute quantized operator attributes, input quantization, and output quantization from floating-point operator attributes and the result of calibration. When this function is called, calib_attrs.input_quant has the types and quantization of the input values (after the inputs have been transformed by quantization), and calib_attrs.quant holds a type and quantization of the output, which this function may overwrite. The output quantization is computed based on calibration. The output type should not be used. This function must assign to calib_attrs.quant the output type and quantization that this operator has after quantization. It may use the default quantization if appropriate. This function may modify attrs. It should modify attrs if the same attribute class is used for both the floating-point and the quantized operator, which would mean that it's designed to store any quantization information in attrs. This function may modify calib_attrs.input_quant to direct quantization to supply different inputs to this operator. The quantization algorithm will insert quantize or dequantize nodes so that the inputs have the type and quantization that were assigned. An exception will be raised if the input can't be provided by inserting a quantize or dequantize node or leaving the input unchanged. The quantized operator attributes are returned. :param attrs: Floating-point operator attributes. :param quantizer_interface: Quantization-related properties of a node's interface before and after quantization, for use when quantizing the node. :param config: Parameters controlling how to quantize. :param error_reporter: Node reporter of the node to be quantized. :returns: Quantized operator attributes. .. py:class:: DepthToSpaceOp An abstract class Stores a list of input key names expected to be passed in by the AwesomeNode for developer reference. .. attribute:: input_list ClassVar[Optional[List[InputName]]]. Used as reference when getting inputs from a dictionary. If input_list is None, AFE will skip validating input_list at runtime .. attribute:: observer_behavior How observers are used in a node during calibration .. py:attribute:: input_list :type: ClassVar[afe.ir.attributes.List[afe.ir.defines.InputName]] .. py:attribute:: observer_behavior :type: ClassVar[ObserverBehavior] .. py:attribute:: depth_to_space_fn :type: Callable[[afe.ir.attributes.DepthToSpaceAttrs, afe.ir.attributes.np.ndarray], afe.ir.attributes.np.ndarray] .. py:method:: get_type(attrs: afe.ir.attributes.Union[afe.ir.attributes.DepthToSpaceAttrs, QUANT_ATTRS]) -> afe.ir.tensor_type.NodeType :classmethod: Get the type of this node given its attributes. The parameter should be a QUANT_ATTRS if that data has been created, or an AWESOME_ATTRIBUTES otherwise. :param attrs: Attributes associated with the operator. It is an AWESOME_ATTRIBUTES if quantization has not transformed the node, or a QUANT_ATTRS if it has. :return: The node's type. .. py:method:: run(attrs: afe.ir.attributes.DepthToSpaceAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.np.ndarray], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Executes the operation in floating point :param attrs: AwesomeAttributes associated with this operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:method:: quantize(attrs: afe.ir.attributes.DepthToSpaceAttrs, quantizer_interface: afe.ir.quantization_interface.OpQuantInterface, config: afe.core.configs.QuantizationConfigs, error_reporter: afe.ir.defines.NodeReporter) -> afe.ir.attributes.DepthToSpaceAttrs :classmethod: Compute quantized operator attributes, input quantization, and output quantization from floating-point operator attributes and the result of calibration. When this function is called, calib_attrs.input_quant has the types and quantization of the input values (after the inputs have been transformed by quantization), and calib_attrs.quant holds a type and quantization of the output, which this function may overwrite. The output quantization is computed based on calibration. The output type should not be used. This function must assign to calib_attrs.quant the output type and quantization that this operator has after quantization. It may use the default quantization if appropriate. This function may modify attrs. It should modify attrs if the same attribute class is used for both the floating-point and the quantized operator, which would mean that it's designed to store any quantization information in attrs. This function may modify calib_attrs.input_quant to direct quantization to supply different inputs to this operator. The quantization algorithm will insert quantize or dequantize nodes so that the inputs have the type and quantization that were assigned. An exception will be raised if the input can't be provided by inserting a quantize or dequantize node or leaving the input unchanged. The quantized operator attributes are returned. :param attrs: Floating-point operator attributes. :param quantizer_interface: Quantization-related properties of a node's interface before and after quantization, for use when quantizing the node. :param config: Parameters controlling how to quantize. :param error_reporter: Node reporter of the node to be quantized. :returns: Quantized operator attributes. .. py:class:: ReshapeOp An abstract class Stores a list of input key names expected to be passed in by the AwesomeNode for developer reference. .. attribute:: input_list ClassVar[Optional[List[InputName]]]. Used as reference when getting inputs from a dictionary. If input_list is None, AFE will skip validating input_list at runtime .. attribute:: observer_behavior How observers are used in a node during calibration .. py:attribute:: input_list :type: ClassVar[afe.ir.attributes.List[afe.ir.defines.InputName]] .. py:attribute:: observer_behavior :type: ClassVar[ObserverBehavior] .. py:attribute:: reshape_fn :type: Callable[[afe.ir.attributes.ReshapeAttrs, afe.ir.attributes.np.ndarray], afe.ir.attributes.np.ndarray] .. py:method:: get_type(attrs: afe.ir.attributes.ReshapeAttrs) -> afe.ir.tensor_type.NodeType :classmethod: Get the type of this node given its attributes. The parameter should be a QUANT_ATTRS if that data has been created, or an AWESOME_ATTRIBUTES otherwise. :param attrs: Attributes associated with the operator. It is an AWESOME_ATTRIBUTES if quantization has not transformed the node, or a QUANT_ATTRS if it has. :return: The node's type. .. py:method:: run(attrs: afe.ir.attributes.ReshapeAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.np.ndarray], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Executes the operation in floating point :param attrs: AwesomeAttributes associated with this operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:method:: quantize(attrs: afe.ir.attributes.ReshapeAttrs, quantizer_interface: afe.ir.quantization_interface.OpQuantInterface, config: afe.core.configs.QuantizationConfigs, error_reporter: afe.ir.defines.NodeReporter) -> afe.ir.attributes.ReshapeAttrs :classmethod: Compute quantized operator attributes, input quantization, and output quantization from floating-point operator attributes and the result of calibration. When this function is called, calib_attrs.input_quant has the types and quantization of the input values (after the inputs have been transformed by quantization), and calib_attrs.quant holds a type and quantization of the output, which this function may overwrite. The output quantization is computed based on calibration. The output type should not be used. This function must assign to calib_attrs.quant the output type and quantization that this operator has after quantization. It may use the default quantization if appropriate. This function may modify attrs. It should modify attrs if the same attribute class is used for both the floating-point and the quantized operator, which would mean that it's designed to store any quantization information in attrs. This function may modify calib_attrs.input_quant to direct quantization to supply different inputs to this operator. The quantization algorithm will insert quantize or dequantize nodes so that the inputs have the type and quantization that were assigned. An exception will be raised if the input can't be provided by inserting a quantize or dequantize node or leaving the input unchanged. The quantized operator attributes are returned. :param attrs: Floating-point operator attributes. :param quantizer_interface: Quantization-related properties of a node's interface before and after quantization, for use when quantizing the node. :param config: Parameters controlling how to quantize. :param error_reporter: Node reporter of the node to be quantized. :returns: Quantized operator attributes. .. py:class:: ExpandDimsOp An abstract class Stores a list of input key names expected to be passed in by the AwesomeNode for developer reference. .. attribute:: input_list ClassVar[Optional[List[InputName]]]. Used as reference when getting inputs from a dictionary. If input_list is None, AFE will skip validating input_list at runtime .. attribute:: observer_behavior How observers are used in a node during calibration .. py:attribute:: input_list :type: ClassVar[afe.ir.attributes.List[afe.ir.defines.InputName]] .. py:attribute:: observer_behavior :type: ClassVar[ObserverBehavior] .. py:attribute:: expand_dims_fn :type: Callable[[afe.ir.attributes.ReshapeAttrs, afe.ir.attributes.np.ndarray], afe.ir.attributes.np.ndarray] .. py:method:: get_type(attrs: afe.ir.attributes.Union[afe.ir.attributes.ExpandDimsAttrs, QUANT_ATTRS]) -> afe.ir.tensor_type.NodeType :classmethod: Get the type of this node given its attributes. The parameter should be a QUANT_ATTRS if that data has been created, or an AWESOME_ATTRIBUTES otherwise. :param attrs: Attributes associated with the operator. It is an AWESOME_ATTRIBUTES if quantization has not transformed the node, or a QUANT_ATTRS if it has. :return: The node's type. .. py:method:: run(attrs: afe.ir.attributes.ExpandDimsAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.np.ndarray], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Executes the operation in floating point :param attrs: AwesomeAttributes associated with this operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:class:: SplitOp SplitOp takes in one tensor, returns a tuple .. py:attribute:: input_list :type: ClassVar[afe.ir.attributes.List[afe.ir.defines.InputName]] .. py:attribute:: observer_behavior :type: ClassVar[ObserverBehavior] .. py:attribute:: split_fn :type: Callable[[afe.ir.attributes.SplitAttrs, afe.ir.attributes.np.ndarray], afe.ir.attributes.np.ndarray] .. py:method:: get_type(attrs: afe.ir.attributes.Union[afe.ir.attributes.SplitAttrs, QUANT_ATTRS]) -> afe.ir.tensor_type.NodeType :classmethod: Get the type of this node given its attributes. The parameter should be a QUANT_ATTRS if that data has been created, or an AWESOME_ATTRIBUTES otherwise. :param attrs: Attributes associated with the operator. It is an AWESOME_ATTRIBUTES if quantization has not transformed the node, or a QUANT_ATTRS if it has. :return: The node's type. .. py:method:: run(attrs: afe.ir.attributes.SplitAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.np.ndarray], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.Tuple[afe.ir.attributes.np.ndarray, Ellipsis] :classmethod: Executes the operation in floating point :param attrs: AwesomeAttributes associated with this operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:class:: TakeOp An abstract class Stores a list of input key names expected to be passed in by the AwesomeNode for developer reference. .. attribute:: input_list ClassVar[Optional[List[InputName]]]. Used as reference when getting inputs from a dictionary. If input_list is None, AFE will skip validating input_list at runtime .. attribute:: observer_behavior How observers are used in a node during calibration .. py:attribute:: input_list :type: ClassVar[afe.ir.attributes.List[afe.ir.defines.InputName]] .. py:attribute:: observer_behavior :type: ClassVar[ObserverBehavior] .. py:attribute:: take_fn :type: Callable[[afe.ir.attributes.TakeAttrs, afe.ir.attributes.np.ndarray, afe.ir.attributes.np.ndarray], afe.ir.attributes.np.ndarray] .. py:method:: get_type(attrs: afe.ir.attributes.Union[afe.ir.attributes.TakeAttrs, QUANT_ATTRS]) -> afe.ir.tensor_type.NodeType :classmethod: Get the type of this node given its attributes. The parameter should be a QUANT_ATTRS if that data has been created, or an AWESOME_ATTRIBUTES otherwise. :param attrs: Attributes associated with the operator. It is an AWESOME_ATTRIBUTES if quantization has not transformed the node, or a QUANT_ATTRS if it has. :return: The node's type. .. py:method:: run(attrs: afe.ir.attributes.TakeAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.np.ndarray], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Executes the operation in floating point :param attrs: AwesomeAttributes associated with this operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:class:: StridedSliceOp An abstract class Stores a list of input key names expected to be passed in by the AwesomeNode for developer reference. .. attribute:: input_list ClassVar[Optional[List[InputName]]]. Used as reference when getting inputs from a dictionary. If input_list is None, AFE will skip validating input_list at runtime .. attribute:: observer_behavior How observers are used in a node during calibration .. py:attribute:: input_list :type: ClassVar[afe.ir.attributes.List[afe.ir.defines.InputName]] .. py:attribute:: observer_behavior :type: ClassVar[ObserverBehavior] .. py:method:: get_type(attrs: afe.ir.attributes.Union[afe.ir.attributes.StridedSliceAttrs, QUANT_ATTRS]) -> afe.ir.tensor_type.NodeType :classmethod: Get the type of this node given its attributes. The parameter should be a QUANT_ATTRS if that data has been created, or an AWESOME_ATTRIBUTES otherwise. :param attrs: Attributes associated with the operator. It is an AWESOME_ATTRIBUTES if quantization has not transformed the node, or a QUANT_ATTRS if it has. :return: The node's type. .. py:method:: run(attrs: afe.ir.attributes.StridedSliceAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.np.ndarray], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Executes the operation in floating point :param attrs: AwesomeAttributes associated with this operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:method:: quantize(attrs: afe.ir.attributes.StridedSliceAttrs, quantizer_interface: afe.ir.quantization_interface.OpQuantInterface, config: afe.core.configs.QuantizationConfigs, error_reporter: afe.ir.defines.NodeReporter) -> afe.ir.attributes.StridedSliceAttrs :classmethod: Compute quantized operator attributes, input quantization, and output quantization from floating-point operator attributes and the result of calibration. When this function is called, calib_attrs.input_quant has the types and quantization of the input values (after the inputs have been transformed by quantization), and calib_attrs.quant holds a type and quantization of the output, which this function may overwrite. The output quantization is computed based on calibration. The output type should not be used. This function must assign to calib_attrs.quant the output type and quantization that this operator has after quantization. It may use the default quantization if appropriate. This function may modify attrs. It should modify attrs if the same attribute class is used for both the floating-point and the quantized operator, which would mean that it's designed to store any quantization information in attrs. This function may modify calib_attrs.input_quant to direct quantization to supply different inputs to this operator. The quantization algorithm will insert quantize or dequantize nodes so that the inputs have the type and quantization that were assigned. An exception will be raised if the input can't be provided by inserting a quantize or dequantize node or leaving the input unchanged. The quantized operator attributes are returned. :param attrs: Floating-point operator attributes. :param quantizer_interface: Quantization-related properties of a node's interface before and after quantization, for use when quantizing the node. :param config: Parameters controlling how to quantize. :param error_reporter: Node reporter of the node to be quantized. :returns: Quantized operator attributes. .. py:class:: BatchFlattenOp An abstract class Stores a list of input key names expected to be passed in by the AwesomeNode for developer reference. .. attribute:: input_list ClassVar[Optional[List[InputName]]]. Used as reference when getting inputs from a dictionary. If input_list is None, AFE will skip validating input_list at runtime .. attribute:: observer_behavior How observers are used in a node during calibration .. py:attribute:: input_list :type: ClassVar[afe.ir.attributes.List[afe.ir.defines.InputName]] .. py:attribute:: observer_behavior :type: ClassVar[ObserverBehavior] .. py:attribute:: batch_flatten_fn :type: Callable[[afe.ir.attributes.np.ndarray], afe.ir.attributes.np.ndarray] .. py:method:: get_type(attrs: afe.ir.attributes.Union[afe.ir.attributes.BatchFlattenAttrs, QUANT_ATTRS]) -> afe.ir.tensor_type.NodeType :classmethod: Get the type of this node given its attributes. The parameter should be a QUANT_ATTRS if that data has been created, or an AWESOME_ATTRIBUTES otherwise. :param attrs: Attributes associated with the operator. It is an AWESOME_ATTRIBUTES if quantization has not transformed the node, or a QUANT_ATTRS if it has. :return: The node's type. .. py:method:: run(attrs: afe.ir.attributes.BatchFlattenAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.np.ndarray], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Executes the operation in floating point :param attrs: AwesomeAttributes associated with this operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:method:: quantize(attrs: afe.ir.attributes.BatchFlattenAttrs, quantizer_interface: afe.ir.quantization_interface.OpQuantInterface, config: afe.core.configs.QuantizationConfigs, error_reporter: afe.ir.defines.NodeReporter) -> afe.ir.attributes.BatchFlattenAttrs :classmethod: Compute quantized operator attributes, input quantization, and output quantization from floating-point operator attributes and the result of calibration. When this function is called, calib_attrs.input_quant has the types and quantization of the input values (after the inputs have been transformed by quantization), and calib_attrs.quant holds a type and quantization of the output, which this function may overwrite. The output quantization is computed based on calibration. The output type should not be used. This function must assign to calib_attrs.quant the output type and quantization that this operator has after quantization. It may use the default quantization if appropriate. This function may modify attrs. It should modify attrs if the same attribute class is used for both the floating-point and the quantized operator, which would mean that it's designed to store any quantization information in attrs. This function may modify calib_attrs.input_quant to direct quantization to supply different inputs to this operator. The quantization algorithm will insert quantize or dequantize nodes so that the inputs have the type and quantization that were assigned. An exception will be raised if the input can't be provided by inserting a quantize or dequantize node or leaving the input unchanged. The quantized operator attributes are returned. :param attrs: Floating-point operator attributes. :param quantizer_interface: Quantization-related properties of a node's interface before and after quantization, for use when quantizing the node. :param config: Parameters controlling how to quantize. :param error_reporter: Node reporter of the node to be quantized. :returns: Quantized operator attributes. .. py:class:: LayoutTransformOp An abstract class Stores a list of input key names expected to be passed in by the AwesomeNode for developer reference. .. attribute:: input_list ClassVar[Optional[List[InputName]]]. Used as reference when getting inputs from a dictionary. If input_list is None, AFE will skip validating input_list at runtime .. attribute:: observer_behavior How observers are used in a node during calibration .. py:attribute:: input_list :type: ClassVar[afe.ir.attributes.List[afe.ir.defines.InputName]] .. py:attribute:: observer_behavior :type: ClassVar[ObserverBehavior] .. py:attribute:: layout_transform_fn :type: Callable[[afe.ir.attributes.np.ndarray], afe.ir.attributes.np.ndarray] .. py:method:: get_type(attrs: afe.ir.attributes.LayoutTransformAttrs) -> afe.ir.tensor_type.NodeType :classmethod: Get the type of this node given its attributes. The parameter should be a QUANT_ATTRS if that data has been created, or an AWESOME_ATTRIBUTES otherwise. :param attrs: Attributes associated with the operator. It is an AWESOME_ATTRIBUTES if quantization has not transformed the node, or a QUANT_ATTRS if it has. :return: The node's type. .. py:method:: run(attrs: afe.ir.attributes.LayoutTransformAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.np.ndarray], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Executes the operation in floating point :param attrs: AwesomeAttributes associated with this operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:method:: quantize(attrs: afe.ir.attributes.LayoutTransformAttrs, quantizer_interface: afe.ir.quantization_interface.OpQuantInterface, config: afe.core.configs.QuantizationConfigs, error_reporter: afe.ir.defines.NodeReporter) -> afe.ir.attributes.AwesomeQuantAttrBase :classmethod: Compute quantized operator attributes, input quantization, and output quantization from floating-point operator attributes and the result of calibration. When this function is called, calib_attrs.input_quant has the types and quantization of the input values (after the inputs have been transformed by quantization), and calib_attrs.quant holds a type and quantization of the output, which this function may overwrite. The output quantization is computed based on calibration. The output type should not be used. This function must assign to calib_attrs.quant the output type and quantization that this operator has after quantization. It may use the default quantization if appropriate. This function may modify attrs. It should modify attrs if the same attribute class is used for both the floating-point and the quantized operator, which would mean that it's designed to store any quantization information in attrs. This function may modify calib_attrs.input_quant to direct quantization to supply different inputs to this operator. The quantization algorithm will insert quantize or dequantize nodes so that the inputs have the type and quantization that were assigned. An exception will be raised if the input can't be provided by inserting a quantize or dequantize node or leaving the input unchanged. The quantized operator attributes are returned. :param attrs: Floating-point operator attributes. :param quantizer_interface: Quantization-related properties of a node's interface before and after quantization, for use when quantizing the node. :param config: Parameters controlling how to quantize. :param error_reporter: Node reporter of the node to be quantized. :returns: Quantized operator attributes. .. py:class:: TessellationTransformOp An abstract class Stores a list of input key names expected to be passed in by the AwesomeNode for developer reference. .. attribute:: input_list ClassVar[Optional[List[InputName]]]. Used as reference when getting inputs from a dictionary. If input_list is None, AFE will skip validating input_list at runtime .. attribute:: observer_behavior How observers are used in a node during calibration .. py:attribute:: input_list :type: ClassVar[afe.ir.attributes.List[afe.ir.defines.InputName]] .. py:attribute:: observer_behavior :type: ClassVar[ObserverBehavior] .. py:method:: get_type(attrs: afe.ir.attributes.Union[AWESOME_ATTRS, QUANT_ATTRS]) -> afe.ir.tensor_type.NodeType :classmethod: Get the type of this node given its attributes. The parameter should be a QUANT_ATTRS if that data has been created, or an AWESOME_ATTRIBUTES otherwise. :param attrs: Attributes associated with the operator. It is an AWESOME_ATTRIBUTES if quantization has not transformed the node, or a QUANT_ATTRS if it has. :return: The node's type. .. py:method:: run(attrs: afe.ir.attributes.TessellationTransformAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.np.ndarray], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Executes the operation in floating point :param attrs: AwesomeAttributes associated with this operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:class:: DetessellationTransformOp An abstract class Stores a list of input key names expected to be passed in by the AwesomeNode for developer reference. .. attribute:: input_list ClassVar[Optional[List[InputName]]]. Used as reference when getting inputs from a dictionary. If input_list is None, AFE will skip validating input_list at runtime .. attribute:: observer_behavior How observers are used in a node during calibration .. py:attribute:: input_list :type: ClassVar[afe.ir.attributes.List[afe.ir.defines.InputName]] .. py:attribute:: observer_behavior :type: ClassVar[ObserverBehavior] .. py:method:: get_type(attrs: afe.ir.attributes.Union[AWESOME_ATTRS, QUANT_ATTRS]) -> afe.ir.tensor_type.NodeType :classmethod: Get the type of this node given its attributes. The parameter should be a QUANT_ATTRS if that data has been created, or an AWESOME_ATTRIBUTES otherwise. :param attrs: Attributes associated with the operator. It is an AWESOME_ATTRIBUTES if quantization has not transformed the node, or a QUANT_ATTRS if it has. :return: The node's type. .. py:method:: run(attrs: afe.ir.attributes.DetessellationTransformAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.np.ndarray], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Executes the operation in floating point :param attrs: AwesomeAttributes associated with this operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:class:: PackTransformOp An abstract class Stores a list of input key names expected to be passed in by the AwesomeNode for developer reference. .. attribute:: input_list ClassVar[Optional[List[InputName]]]. Used as reference when getting inputs from a dictionary. If input_list is None, AFE will skip validating input_list at runtime .. attribute:: observer_behavior How observers are used in a node during calibration .. py:attribute:: input_list :type: ClassVar[afe.ir.attributes.List[afe.ir.defines.InputName]] :value: None .. py:attribute:: observer_behavior :type: ClassVar[ObserverBehavior] .. py:method:: get_type(attrs: afe.ir.attributes.PackTransformAttrs) -> afe.ir.tensor_type.NodeType :classmethod: Get the type of this node given its attributes. The parameter should be a QUANT_ATTRS if that data has been created, or an AWESOME_ATTRIBUTES otherwise. :param attrs: Attributes associated with the operator. It is an AWESOME_ATTRIBUTES if quantization has not transformed the node, or a QUANT_ATTRS if it has. :return: The node's type. .. py:method:: run(_: afe.ir.attributes.PackTransformAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.np.ndarray], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Executes the operation in floating point :param attrs: AwesomeAttributes associated with this operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:class:: UnpackTransformOp An abstract class Stores a list of input key names expected to be passed in by the AwesomeNode for developer reference. .. attribute:: input_list ClassVar[Optional[List[InputName]]]. Used as reference when getting inputs from a dictionary. If input_list is None, AFE will skip validating input_list at runtime .. attribute:: observer_behavior How observers are used in a node during calibration .. py:attribute:: input_list :type: ClassVar[afe.ir.attributes.List[afe.ir.defines.InputName]] .. py:attribute:: observer_behavior :type: ClassVar[ObserverBehavior] .. py:method:: get_type(attrs: afe.ir.attributes.Union[AWESOME_ATTRS, QUANT_ATTRS]) -> afe.ir.tensor_type.NodeType :classmethod: Get the type of this node given its attributes. The parameter should be a QUANT_ATTRS if that data has been created, or an AWESOME_ATTRIBUTES otherwise. :param attrs: Attributes associated with the operator. It is an AWESOME_ATTRIBUTES if quantization has not transformed the node, or a QUANT_ATTRS if it has. :return: The node's type. .. py:method:: run(attrs: afe.ir.attributes.UnpackTransformAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.np.ndarray], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Executes the operation in floating point :param attrs: AwesomeAttributes associated with this operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:class:: NormalizationTransformOp An abstract class Stores a list of input key names expected to be passed in by the AwesomeNode for developer reference. .. attribute:: input_list ClassVar[Optional[List[InputName]]]. Used as reference when getting inputs from a dictionary. If input_list is None, AFE will skip validating input_list at runtime .. attribute:: observer_behavior How observers are used in a node during calibration .. py:attribute:: input_list :type: ClassVar[afe.ir.attributes.List[afe.ir.defines.InputName]] .. py:attribute:: observer_behavior :type: ClassVar[ObserverBehavior] .. py:method:: get_type(attrs: afe.ir.attributes.Union[AWESOME_ATTRS, QUANT_ATTRS]) -> afe.ir.tensor_type.NodeType :classmethod: Get the type of this node given its attributes. The parameter should be a QUANT_ATTRS if that data has been created, or an AWESOME_ATTRIBUTES otherwise. :param attrs: Attributes associated with the operator. It is an AWESOME_ATTRIBUTES if quantization has not transformed the node, or a QUANT_ATTRS if it has. :return: The node's type. .. py:method:: run(attrs: afe.ir.attributes.NormalizationTransformAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.np.ndarray], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Executes the operation in floating point :param attrs: AwesomeAttributes associated with this operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:class:: QuantizationTransformOp An abstract class Stores a list of input key names expected to be passed in by the AwesomeNode for developer reference. .. attribute:: input_list ClassVar[Optional[List[InputName]]]. Used as reference when getting inputs from a dictionary. If input_list is None, AFE will skip validating input_list at runtime .. attribute:: observer_behavior How observers are used in a node during calibration .. py:attribute:: input_list :type: ClassVar[afe.ir.attributes.List[afe.ir.defines.InputName]] .. py:attribute:: observer_behavior :type: ClassVar[ObserverBehavior] .. py:method:: get_type(attrs: afe.ir.attributes.Union[AWESOME_ATTRS, QUANT_ATTRS]) -> afe.ir.tensor_type.NodeType :classmethod: Get the type of this node given its attributes. The parameter should be a QUANT_ATTRS if that data has been created, or an AWESOME_ATTRIBUTES otherwise. :param attrs: Attributes associated with the operator. It is an AWESOME_ATTRIBUTES if quantization has not transformed the node, or a QUANT_ATTRS if it has. :return: The node's type. .. py:method:: run(attrs: afe.ir.attributes.QuantizationTransformAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.np.ndarray], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Executes the operation in floating point :param attrs: AwesomeAttributes associated with this operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:class:: DequantizationTransformOp An abstract class Stores a list of input key names expected to be passed in by the AwesomeNode for developer reference. .. attribute:: input_list ClassVar[Optional[List[InputName]]]. Used as reference when getting inputs from a dictionary. If input_list is None, AFE will skip validating input_list at runtime .. attribute:: observer_behavior How observers are used in a node during calibration .. py:attribute:: input_list :type: ClassVar[afe.ir.attributes.List[afe.ir.defines.InputName]] .. py:attribute:: observer_behavior :type: ClassVar[ObserverBehavior] .. py:method:: get_type(attrs: afe.ir.attributes.Union[AWESOME_ATTRS, QUANT_ATTRS]) -> afe.ir.tensor_type.NodeType :classmethod: Get the type of this node given its attributes. The parameter should be a QUANT_ATTRS if that data has been created, or an AWESOME_ATTRIBUTES otherwise. :param attrs: Attributes associated with the operator. It is an AWESOME_ATTRIBUTES if quantization has not transformed the node, or a QUANT_ATTRS if it has. :return: The node's type. .. py:method:: run(attrs: afe.ir.attributes.DequantizationTransformAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.np.ndarray], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Executes the operation in floating point :param attrs: AwesomeAttributes associated with this operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:class:: ResizeTransformOp An abstract class Stores a list of input key names expected to be passed in by the AwesomeNode for developer reference. .. attribute:: input_list ClassVar[Optional[List[InputName]]]. Used as reference when getting inputs from a dictionary. If input_list is None, AFE will skip validating input_list at runtime .. attribute:: observer_behavior How observers are used in a node during calibration .. py:attribute:: input_list :type: ClassVar[afe.ir.attributes.List[afe.ir.defines.InputName]] .. py:attribute:: observer_behavior :type: ClassVar[ObserverBehavior] .. py:method:: get_type(attrs: afe.ir.attributes.Union[AWESOME_ATTRS, QUANT_ATTRS]) -> afe.ir.tensor_type.NodeType :classmethod: Get the type of this node given its attributes. The parameter should be a QUANT_ATTRS if that data has been created, or an AWESOME_ATTRIBUTES otherwise. :param attrs: Attributes associated with the operator. It is an AWESOME_ATTRIBUTES if quantization has not transformed the node, or a QUANT_ATTRS if it has. :return: The node's type. .. py:method:: run(attrs: afe.ir.attributes.ResizeTransformAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.np.ndarray], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Executes the operation in floating point :param attrs: AwesomeAttributes associated with this operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:class:: ChromaUpsampleTransformOp An abstract class Stores a list of input key names expected to be passed in by the AwesomeNode for developer reference. .. attribute:: input_list ClassVar[Optional[List[InputName]]]. Used as reference when getting inputs from a dictionary. If input_list is None, AFE will skip validating input_list at runtime .. attribute:: observer_behavior How observers are used in a node during calibration .. py:attribute:: input_list :type: ClassVar[afe.ir.attributes.List[afe.ir.defines.InputName]] .. py:attribute:: observer_behavior :type: ClassVar[ObserverBehavior] .. py:method:: get_type(attrs: afe.ir.attributes.Union[AWESOME_ATTRS, QUANT_ATTRS]) -> afe.ir.tensor_type.NodeType :classmethod: Get the type of this node given its attributes. The parameter should be a QUANT_ATTRS if that data has been created, or an AWESOME_ATTRIBUTES otherwise. :param attrs: Attributes associated with the operator. It is an AWESOME_ATTRIBUTES if quantization has not transformed the node, or a QUANT_ATTRS if it has. :return: The node's type. .. py:method:: run(attrs: afe.ir.attributes.ChromaUpsampleTransformAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.np.ndarray], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Executes the operation in floating point :param attrs: AwesomeAttributes associated with this operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:class:: YuvRgbConversionTransformOp An abstract class Stores a list of input key names expected to be passed in by the AwesomeNode for developer reference. .. attribute:: input_list ClassVar[Optional[List[InputName]]]. Used as reference when getting inputs from a dictionary. If input_list is None, AFE will skip validating input_list at runtime .. attribute:: observer_behavior How observers are used in a node during calibration .. py:attribute:: input_list :type: ClassVar[afe.ir.attributes.List[afe.ir.defines.InputName]] .. py:attribute:: observer_behavior :type: ClassVar[ObserverBehavior] .. py:method:: get_type(attrs: afe.ir.attributes.Union[AWESOME_ATTRS, QUANT_ATTRS]) -> afe.ir.tensor_type.NodeType :classmethod: Get the type of this node given its attributes. The parameter should be a QUANT_ATTRS if that data has been created, or an AWESOME_ATTRIBUTES otherwise. :param attrs: Attributes associated with the operator. It is an AWESOME_ATTRIBUTES if quantization has not transformed the node, or a QUANT_ATTRS if it has. :return: The node's type. .. py:method:: run(attrs: afe.ir.attributes.YuvRgbConversionTransformAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.np.ndarray], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Executes the operation in floating point :param attrs: AwesomeAttributes associated with this operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:class:: BgrRgbConversionTransformOp An abstract class Stores a list of input key names expected to be passed in by the AwesomeNode for developer reference. .. attribute:: input_list ClassVar[Optional[List[InputName]]]. Used as reference when getting inputs from a dictionary. If input_list is None, AFE will skip validating input_list at runtime .. attribute:: observer_behavior How observers are used in a node during calibration .. py:attribute:: input_list :type: ClassVar[afe.ir.attributes.List[afe.ir.defines.InputName]] .. py:attribute:: observer_behavior :type: ClassVar[ObserverBehavior] .. py:method:: get_type(attrs: afe.ir.attributes.Union[AWESOME_ATTRS, QUANT_ATTRS]) -> afe.ir.tensor_type.NodeType :classmethod: Get the type of this node given its attributes. The parameter should be a QUANT_ATTRS if that data has been created, or an AWESOME_ATTRIBUTES otherwise. :param attrs: Attributes associated with the operator. It is an AWESOME_ATTRIBUTES if quantization has not transformed the node, or a QUANT_ATTRS if it has. :return: The node's type. .. py:method:: run(attrs: afe.ir.attributes.BgrRgbConversionTransformAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.np.ndarray], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Executes the operation in floating point :param attrs: AwesomeAttributes associated with this operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:class:: SigmoidTransformOp An abstract class Stores a list of input key names expected to be passed in by the AwesomeNode for developer reference. .. attribute:: input_list ClassVar[Optional[List[InputName]]]. Used as reference when getting inputs from a dictionary. If input_list is None, AFE will skip validating input_list at runtime .. attribute:: observer_behavior How observers are used in a node during calibration .. py:attribute:: input_list :type: ClassVar[afe.ir.attributes.List[afe.ir.defines.InputName]] .. py:attribute:: observer_behavior :type: ClassVar[ObserverBehavior] .. py:method:: get_type(attrs: afe.ir.attributes.Union[AWESOME_ATTRS, QUANT_ATTRS]) -> afe.ir.tensor_type.NodeType :classmethod: Get the type of this node given its attributes. The parameter should be a QUANT_ATTRS if that data has been created, or an AWESOME_ATTRIBUTES otherwise. :param attrs: Attributes associated with the operator. It is an AWESOME_ATTRIBUTES if quantization has not transformed the node, or a QUANT_ATTRS if it has. :return: The node's type. .. py:method:: run(attrs: afe.ir.attributes.SigmoidTransformAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.np.ndarray], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Executes the operation in floating point :param attrs: AwesomeAttributes associated with this operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:class:: NmsMaxpoolTransformOp An abstract class Stores a list of input key names expected to be passed in by the AwesomeNode for developer reference. .. attribute:: input_list ClassVar[Optional[List[InputName]]]. Used as reference when getting inputs from a dictionary. If input_list is None, AFE will skip validating input_list at runtime .. attribute:: observer_behavior How observers are used in a node during calibration .. py:attribute:: input_list :type: ClassVar[afe.ir.attributes.List[afe.ir.defines.InputName]] .. py:attribute:: observer_behavior :type: ClassVar[ObserverBehavior] .. py:method:: get_type(attrs: afe.ir.attributes.Union[AWESOME_ATTRS, QUANT_ATTRS]) -> afe.ir.tensor_type.NodeType :classmethod: Get the type of this node given its attributes. The parameter should be a QUANT_ATTRS if that data has been created, or an AWESOME_ATTRIBUTES otherwise. :param attrs: Attributes associated with the operator. It is an AWESOME_ATTRIBUTES if quantization has not transformed the node, or a QUANT_ATTRS if it has. :return: The node's type. .. py:method:: run(attrs: afe.ir.attributes.NmsMaxpoolTransformAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.np.ndarray], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Executes the operation in floating point :param attrs: AwesomeAttributes associated with this operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:class:: CastOp An abstract class Stores a list of input key names expected to be passed in by the AwesomeNode for developer reference. .. attribute:: input_list ClassVar[Optional[List[InputName]]]. Used as reference when getting inputs from a dictionary. If input_list is None, AFE will skip validating input_list at runtime .. attribute:: observer_behavior How observers are used in a node during calibration .. py:attribute:: input_list :type: ClassVar[afe.ir.attributes.List[afe.ir.defines.InputName]] .. py:attribute:: observer_behavior :type: ClassVar[ObserverBehavior] .. py:attribute:: cast_fn :type: Callable[[afe.ir.attributes.CastAttrs, afe.ir.attributes.np.ndarray], afe.ir.attributes.np.ndarray] .. py:method:: get_type(attrs: afe.ir.attributes.Union[afe.ir.attributes.CastAttrs, QUANT_ATTRS]) -> afe.ir.tensor_type.NodeType :classmethod: Get the type of this node given its attributes. The parameter should be a QUANT_ATTRS if that data has been created, or an AWESOME_ATTRIBUTES otherwise. :param attrs: Attributes associated with the operator. It is an AWESOME_ATTRIBUTES if quantization has not transformed the node, or a QUANT_ATTRS if it has. :return: The node's type. .. py:method:: run(attrs: afe.ir.attributes.CastAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.np.ndarray], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Executes the operation in floating point :param attrs: AwesomeAttributes associated with this operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:class:: AddActivationOp An abstract class Stores a list of input key names expected to be passed in by the AwesomeNode for developer reference. .. attribute:: input_list ClassVar[Optional[List[InputName]]]. Used as reference when getting inputs from a dictionary. If input_list is None, AFE will skip validating input_list at runtime .. attribute:: observer_behavior How observers are used in a node during calibration .. py:attribute:: input_list :type: ClassVar[afe.ir.attributes.List[afe.ir.defines.InputName]] .. py:attribute:: observer_behavior The AddActivationOp can only handle the: * Add + Relu * Add + Clip .. py:attribute:: relu_fn :type: Callable[[afe.ir.attributes.np.ndarray, int], afe.ir.attributes.np.ndarray] .. py:attribute:: clip_fn :type: Callable[[afe.ir.attributes.ClipAttrs | afe.ir.attributes.ClipQuantAttrs, afe.ir.attributes.np.ndarray], afe.ir.attributes.np.ndarray] .. py:method:: get_type(attrs: afe.ir.attributes.Union[afe.ir.attributes.AddActivationAttrs, afe.ir.attributes.AddQuantAttrs]) -> afe.ir.tensor_type.NodeType :classmethod: Get the type of this node given its attributes. The parameter should be a QUANT_ATTRS if that data has been created, or an AWESOME_ATTRIBUTES otherwise. :param attrs: Attributes associated with the operator. It is an AWESOME_ATTRIBUTES if quantization has not transformed the node, or a QUANT_ATTRS if it has. :return: The node's type. .. py:method:: run(attrs: afe.ir.attributes.AddActivationAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.np.ndarray], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Executes the operation in floating point :param attrs: AwesomeAttributes associated with this operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:method:: quantize(attrs: afe.ir.attributes.AddActivationAttrs, quantizer_interface: afe.ir.quantization_interface.OpQuantInterface, config: afe.core.configs.QuantizationConfigs, error_reporter: afe.ir.defines.NodeReporter) -> afe.ir.attributes.Union[afe.ir.attributes.AddActivationAttrs, afe.ir.attributes.AddQuantAttrs] :classmethod: Compute quantized operator attributes, input quantization, and output quantization from floating-point operator attributes and the result of calibration. When this function is called, calib_attrs.input_quant has the types and quantization of the input values (after the inputs have been transformed by quantization), and calib_attrs.quant holds a type and quantization of the output, which this function may overwrite. The output quantization is computed based on calibration. The output type should not be used. This function must assign to calib_attrs.quant the output type and quantization that this operator has after quantization. It may use the default quantization if appropriate. This function may modify attrs. It should modify attrs if the same attribute class is used for both the floating-point and the quantized operator, which would mean that it's designed to store any quantization information in attrs. This function may modify calib_attrs.input_quant to direct quantization to supply different inputs to this operator. The quantization algorithm will insert quantize or dequantize nodes so that the inputs have the type and quantization that were assigned. An exception will be raised if the input can't be provided by inserting a quantize or dequantize node or leaving the input unchanged. The quantized operator attributes are returned. :param attrs: Floating-point operator attributes. :param quantizer_interface: Quantization-related properties of a node's interface before and after quantization, for use when quantizing the node. :param config: Parameters controlling how to quantize. :param error_reporter: Node reporter of the node to be quantized. :returns: Quantized operator attributes. .. py:method:: run_quant(quant_attrs: afe.ir.attributes.AddQuantAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.Any], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Execute the operation using quantized arithmetic. :param quant_attrs: Parameters that define the quantized operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:class:: ConstantMultiplyAddOp An add operator fused with multiplication by a scalar constant. The operator performs the floating-point operation (a*c + b*d), where c and d are scalar constants. After quantization, it behaves like an add operator. The multiplication is incorporated into the add operator's requantization. .. py:attribute:: observer_behavior The AddActivationOp can only handle the: * Add + Relu * Add + Clip .. py:method:: get_type(attrs: afe.ir.attributes.Union[afe.ir.attributes.ConstantMultiplyAddAttrs, afe.ir.attributes.AddQuantAttrs]) -> afe.ir.tensor_type.NodeType :classmethod: Get the type of this node given its attributes. The parameter should be a QUANT_ATTRS if that data has been created, or an AWESOME_ATTRIBUTES otherwise. :param attrs: Attributes associated with the operator. It is an AWESOME_ATTRIBUTES if quantization has not transformed the node, or a QUANT_ATTRS if it has. :return: The node's type. .. py:method:: run(attrs: afe.ir.attributes.ConstantMultiplyAddAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.np.ndarray], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Executes the operation in floating point :param attrs: AwesomeAttributes associated with this operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:method:: quantize(attrs: afe.ir.attributes.ConstantMultiplyAddAttrs, quantizer_interface: afe.ir.quantization_interface.OpQuantInterface, config: afe.core.configs.QuantizationConfigs, error_reporter: afe.ir.defines.NodeReporter) -> afe.ir.attributes.Union[afe.ir.attributes.AddQuantAttrs, afe.ir.attributes.ConstantMultiplyAddAttrs] :classmethod: Compute quantized operator attributes, input quantization, and output quantization from floating-point operator attributes and the result of calibration. When this function is called, calib_attrs.input_quant has the types and quantization of the input values (after the inputs have been transformed by quantization), and calib_attrs.quant holds a type and quantization of the output, which this function may overwrite. The output quantization is computed based on calibration. The output type should not be used. This function must assign to calib_attrs.quant the output type and quantization that this operator has after quantization. It may use the default quantization if appropriate. This function may modify attrs. It should modify attrs if the same attribute class is used for both the floating-point and the quantized operator, which would mean that it's designed to store any quantization information in attrs. This function may modify calib_attrs.input_quant to direct quantization to supply different inputs to this operator. The quantization algorithm will insert quantize or dequantize nodes so that the inputs have the type and quantization that were assigned. An exception will be raised if the input can't be provided by inserting a quantize or dequantize node or leaving the input unchanged. The quantized operator attributes are returned. :param attrs: Floating-point operator attributes. :param quantizer_interface: Quantization-related properties of a node's interface before and after quantization, for use when quantizing the node. :param config: Parameters controlling how to quantize. :param error_reporter: Node reporter of the node to be quantized. :returns: Quantized operator attributes. .. py:class:: ConvolutionObserverBehavior Abstract base class of observer behavior associated with an operator. .. py:method:: create_observers(calib_config: afe.core.configs.CalibrationConfigs, quant_config: afe.core.configs.QuantizationConfigs, calib_attrs: afe.ir.attributes.AwesomeCalibAttrs, attrs: AWESOME_ATTRS, reporter: afe.ir.defines.NodeReporter) -> afe.ir.attributes.Tuple[afe.ir.attributes.NodeObserver | None, afe.ir.attributes.Dict[str, afe.ir.attributes.NodeObserver]] Create new observers for a node as needed for calibration. For operators that do not use observers, return (None, {}). The caller may save the returned observers in calib_attrs for use in calibration and quantization. :param calib_config: Configuration parameters for calibration :param quant_config: Configuration parameters for quantization :param calib_attrs: The node's calibration attributes :param attrs: The node's attributes :param reporter: How to process errors that occur in the observers :returns: Observer for the node's output and observers for intermediate values .. py:method:: get_observed_distribution(calib_attrs: afe.ir.attributes.AwesomeCalibAttrs, inputs: afe.ir.attributes.Dict[afe.ir.defines.InputName, QuantizationTensorData]) -> afe.ir.attributes.Tuple[afe.ir.attributes.ObservedDistribution | None, afe.ir.attributes.Dict[str, afe.ir.attributes.ObservedDistribution]] Get observed distribution and intermediate observed distributions. The observed distribution can be None for operators that do not use observers or if calibration was not performed. :param calib_attrs: Calibration attributes. :param inputs: Properties of the inputs. It has quantization scales of the input tensors and attributes of the nodes that calculate the inputs. :returns: Tuple of observed distribution and dictionary of intermediate observed distributions. .. py:class:: ConvAddActivationOp An abstract class Stores a list of input key names expected to be passed in by the AwesomeNode for developer reference. .. attribute:: input_list ClassVar[Optional[List[InputName]]]. Used as reference when getting inputs from a dictionary. If input_list is None, AFE will skip validating input_list at runtime .. attribute:: observer_behavior How observers are used in a node during calibration .. py:attribute:: relu_fn :type: Callable[[afe.ir.attributes.np.ndarray, int], afe.ir.attributes.np.ndarray] .. py:attribute:: clip_fn :type: Callable[[afe.ir.attributes.ClipAttrs | afe.ir.attributes.ClipQuantAttrs, afe.ir.attributes.np.ndarray], afe.ir.attributes.np.ndarray] .. py:attribute:: input_list :type: ClassVar[afe.ir.attributes.List[afe.ir.defines.InputName]] .. py:attribute:: observer_behavior .. py:method:: get_type(attrs: afe.ir.attributes.ConvAddActivationAttrs | afe.ir.attributes.ConvQuantAttrs) -> afe.ir.tensor_type.NodeType :classmethod: Get the type of this node given its attributes. The parameter should be a QUANT_ATTRS if that data has been created, or an AWESOME_ATTRIBUTES otherwise. :param attrs: Attributes associated with the operator. It is an AWESOME_ATTRIBUTES if quantization has not transformed the node, or a QUANT_ATTRS if it has. :return: The node's type. .. py:method:: run(attrs: afe.ir.attributes.ConvAddActivationAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.np.ndarray], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Executes the operation in floating point :param attrs: AwesomeAttributes associated with this operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:method:: quantize(attrs: afe.ir.attributes.ConvAddActivationAttrs, quantizer_interface: afe.ir.quantization_interface.OpQuantInterface, config: afe.core.configs.QuantizationConfigs, error_reporter: afe.ir.defines.NodeReporter) -> afe.ir.attributes.ConvAddActivationAttrs | afe.ir.attributes.ConvQuantAttrs :classmethod: Compute quantized operator attributes, input quantization, and output quantization from floating-point operator attributes and the result of calibration. When this function is called, calib_attrs.input_quant has the types and quantization of the input values (after the inputs have been transformed by quantization), and calib_attrs.quant holds a type and quantization of the output, which this function may overwrite. The output quantization is computed based on calibration. The output type should not be used. This function must assign to calib_attrs.quant the output type and quantization that this operator has after quantization. It may use the default quantization if appropriate. This function may modify attrs. It should modify attrs if the same attribute class is used for both the floating-point and the quantized operator, which would mean that it's designed to store any quantization information in attrs. This function may modify calib_attrs.input_quant to direct quantization to supply different inputs to this operator. The quantization algorithm will insert quantize or dequantize nodes so that the inputs have the type and quantization that were assigned. An exception will be raised if the input can't be provided by inserting a quantize or dequantize node or leaving the input unchanged. The quantized operator attributes are returned. :param attrs: Floating-point operator attributes. :param quantizer_interface: Quantization-related properties of a node's interface before and after quantization, for use when quantizing the node. :param config: Parameters controlling how to quantize. :param error_reporter: Node reporter of the node to be quantized. :returns: Quantized operator attributes. .. py:method:: run_quant(quant_attrs: afe.ir.attributes.ConvQuantAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.np.ndarray], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Execute the operation using quantized arithmetic. :param quant_attrs: Parameters that define the quantized operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:method:: calibrate(attrs: afe.ir.attributes.ConvAddActivationAttrs, calib_attrs: afe.ir.attributes.AwesomeCalibAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.Any], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.Any :classmethod: ConvAddActivation calibration method. Executes default calibration to get results of ConvAdd operation in floating point. Additionally, update intermediate observers for tracking mean values. :param attrs: AwesomeAttributes associated with this operation :param calib_attrs: AwesomeCalibAttrs associated with operation's node. :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Parameters controlling how to calibrate. :return: Output tensor(s) whose type is dependent on the subclass. .. py:class:: TupleConcatenateOp This composite node reuse ConcatenateOp run, quantize, and run_quant methods .. py:attribute:: input_list :value: None .. py:attribute:: observer_behavior .. py:attribute:: tuple_fn :type: Callable[[afe.ir.attributes.List[afe.ir.attributes.np.ndarray]], tuple] .. py:attribute:: concatenate_op :type: AwesomeOperation .. py:method:: get_type(attrs: afe.ir.attributes.Union[afe.ir.attributes.TupleConcatenateAttrs, afe.ir.attributes.ConcatQuantAttrs]) -> afe.ir.tensor_type.NodeType :classmethod: Get the type of this node given its attributes. The parameter should be a QUANT_ATTRS if that data has been created, or an AWESOME_ATTRIBUTES otherwise. :param attrs: Attributes associated with the operator. It is an AWESOME_ATTRIBUTES if quantization has not transformed the node, or a QUANT_ATTRS if it has. :return: The node's type. .. py:method:: run(attrs: afe.ir.attributes.Union[afe.ir.attributes.TupleConcatenateAttrs, afe.ir.attributes.ConcatenateAttrs], input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.np.ndarray], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Executes the operation in floating point :param attrs: AwesomeAttributes associated with this operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:method:: quantize(attrs: afe.ir.attributes.TupleConcatenateAttrs, quantizer_interface: afe.ir.quantization_interface.OpQuantInterface, config: afe.core.configs.QuantizationConfigs, error_reporter: afe.ir.defines.NodeReporter) -> afe.ir.attributes.ConcatQuantAttrs :classmethod: Compute quantized operator attributes, input quantization, and output quantization from floating-point operator attributes and the result of calibration. When this function is called, calib_attrs.input_quant has the types and quantization of the input values (after the inputs have been transformed by quantization), and calib_attrs.quant holds a type and quantization of the output, which this function may overwrite. The output quantization is computed based on calibration. The output type should not be used. This function must assign to calib_attrs.quant the output type and quantization that this operator has after quantization. It may use the default quantization if appropriate. This function may modify attrs. It should modify attrs if the same attribute class is used for both the floating-point and the quantized operator, which would mean that it's designed to store any quantization information in attrs. This function may modify calib_attrs.input_quant to direct quantization to supply different inputs to this operator. The quantization algorithm will insert quantize or dequantize nodes so that the inputs have the type and quantization that were assigned. An exception will be raised if the input can't be provided by inserting a quantize or dequantize node or leaving the input unchanged. The quantized operator attributes are returned. :param attrs: Floating-point operator attributes. :param quantizer_interface: Quantization-related properties of a node's interface before and after quantization, for use when quantizing the node. :param config: Parameters controlling how to quantize. :param error_reporter: Node reporter of the node to be quantized. :returns: Quantized operator attributes. .. py:method:: run_quant(quant_attrs: afe.ir.attributes.ConcatQuantAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.np.ndarray], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Execute the operation using quantized arithmetic. :param quant_attrs: Parameters that define the quantized operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:class:: ExternalOp An abstract class Stores a list of input key names expected to be passed in by the AwesomeNode for developer reference. .. attribute:: input_list ClassVar[Optional[List[InputName]]]. Used as reference when getting inputs from a dictionary. If input_list is None, AFE will skip validating input_list at runtime .. attribute:: observer_behavior How observers are used in a node during calibration .. py:attribute:: input_list :value: None .. py:attribute:: observer_behavior .. py:attribute:: external_fn :type: Callable[[afe.ir.attributes.ExternalAttrs, afe.ir.attributes.Dict], afe.ir.attributes.Union[afe.ir.attributes.np.ndarray, tuple]] .. py:method:: get_type(attrs: afe.ir.attributes.Union[afe.ir.attributes.ExternalAttrs, afe.ir.attributes.AwesomeQuantAttrBase]) -> afe.ir.tensor_type.NodeType :classmethod: Get the type of this node given its attributes. The parameter should be a QUANT_ATTRS if that data has been created, or an AWESOME_ATTRIBUTES otherwise. :param attrs: Attributes associated with the operator. It is an AWESOME_ATTRIBUTES if quantization has not transformed the node, or a QUANT_ATTRS if it has. :return: The node's type. .. py:method:: run(attrs: afe.ir.attributes.ExternalAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.Any], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Executes the operation in floating point :param attrs: AwesomeAttributes associated with this operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:method:: quantize(attrs: afe.ir.attributes.ExternalAttrs, quantizer_interface: afe.ir.quantization_interface.OpQuantInterface, config: afe.core.configs.QuantizationConfigs, error_reporter: afe.ir.defines.NodeReporter) -> afe.ir.attributes.ExternalAttrs :classmethod: Compute quantized operator attributes, input quantization, and output quantization from floating-point operator attributes and the result of calibration. When this function is called, calib_attrs.input_quant has the types and quantization of the input values (after the inputs have been transformed by quantization), and calib_attrs.quant holds a type and quantization of the output, which this function may overwrite. The output quantization is computed based on calibration. The output type should not be used. This function must assign to calib_attrs.quant the output type and quantization that this operator has after quantization. It may use the default quantization if appropriate. This function may modify attrs. It should modify attrs if the same attribute class is used for both the floating-point and the quantized operator, which would mean that it's designed to store any quantization information in attrs. This function may modify calib_attrs.input_quant to direct quantization to supply different inputs to this operator. The quantization algorithm will insert quantize or dequantize nodes so that the inputs have the type and quantization that were assigned. An exception will be raised if the input can't be provided by inserting a quantize or dequantize node or leaving the input unchanged. The quantized operator attributes are returned. :param attrs: Floating-point operator attributes. :param quantizer_interface: Quantization-related properties of a node's interface before and after quantization, for use when quantizing the node. :param config: Parameters controlling how to quantize. :param error_reporter: Node reporter of the node to be quantized. :returns: Quantized operator attributes. .. py:class:: QNNQuantizeOp An abstract class Stores a list of input key names expected to be passed in by the AwesomeNode for developer reference. .. attribute:: input_list ClassVar[Optional[List[InputName]]]. Used as reference when getting inputs from a dictionary. If input_list is None, AFE will skip validating input_list at runtime .. attribute:: observer_behavior How observers are used in a node during calibration .. py:attribute:: input_list :type: ClassVar[afe.ir.attributes.List[afe.ir.defines.InputName]] .. py:attribute:: observer_behavior .. py:attribute:: quant_fn :type: Callable[[afe.ir.attributes.QNNQuantizeAttrs, afe.ir.attributes.np.ndarray, afe.ir.attributes.np.ndarray, afe.ir.attributes.np.ndarray], afe.ir.attributes.np.ndarray] .. py:method:: get_type(attrs: afe.ir.attributes.Union[afe.ir.attributes.QNNQuantizeAttrs, QUANT_ATTRS]) -> afe.ir.tensor_type.NodeType :classmethod: Get the type of this node given its attributes. The parameter should be a QUANT_ATTRS if that data has been created, or an AWESOME_ATTRIBUTES otherwise. :param attrs: Attributes associated with the operator. It is an AWESOME_ATTRIBUTES if quantization has not transformed the node, or a QUANT_ATTRS if it has. :return: The node's type. .. py:method:: run(attrs: afe.ir.attributes.QNNQuantizeAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.Any], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Executes the operation in floating point :param attrs: AwesomeAttributes associated with this operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:class:: RequantizeOp An abstract class Stores a list of input key names expected to be passed in by the AwesomeNode for developer reference. .. attribute:: input_list ClassVar[Optional[List[InputName]]]. Used as reference when getting inputs from a dictionary. If input_list is None, AFE will skip validating input_list at runtime .. attribute:: observer_behavior How observers are used in a node during calibration .. py:attribute:: input_list :type: ClassVar[afe.ir.attributes.List[afe.ir.defines.InputName]] .. py:attribute:: observer_behavior .. py:method:: get_type(attrs: afe.ir.attributes.Union[afe.ir.attributes.RequantizeAttrs, afe.ir.attributes.RequantizeQuantAttrs]) -> afe.ir.tensor_type.NodeType :classmethod: Get the type of this node given its attributes. The parameter should be a QUANT_ATTRS if that data has been created, or an AWESOME_ATTRIBUTES otherwise. :param attrs: Attributes associated with the operator. It is an AWESOME_ATTRIBUTES if quantization has not transformed the node, or a QUANT_ATTRS if it has. :return: The node's type. .. py:method:: run_quant(quant_attrs: afe.ir.attributes.RequantizeQuantAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.Any], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Execute the operation using quantized arithmetic. :param quant_attrs: Parameters that define the quantized operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:class:: QNNDequantizeOp An abstract class Stores a list of input key names expected to be passed in by the AwesomeNode for developer reference. .. attribute:: input_list ClassVar[Optional[List[InputName]]]. Used as reference when getting inputs from a dictionary. If input_list is None, AFE will skip validating input_list at runtime .. attribute:: observer_behavior How observers are used in a node during calibration .. py:attribute:: input_list :type: ClassVar[afe.ir.attributes.List[afe.ir.defines.InputName]] .. py:attribute:: observer_behavior .. py:attribute:: dequant_fn :type: Callable[[afe.ir.attributes.QNNDequantizeAttrs, afe.ir.attributes.np.ndarray, afe.ir.attributes.np.ndarray, afe.ir.attributes.np.ndarray], afe.ir.attributes.np.ndarray] .. py:method:: get_type(attrs: afe.ir.attributes.Union[afe.ir.attributes.QNNDequantizeAttrs, QUANT_ATTRS]) -> afe.ir.tensor_type.NodeType :classmethod: Get the type of this node given its attributes. The parameter should be a QUANT_ATTRS if that data has been created, or an AWESOME_ATTRIBUTES otherwise. :param attrs: Attributes associated with the operator. It is an AWESOME_ATTRIBUTES if quantization has not transformed the node, or a QUANT_ATTRS if it has. :return: The node's type. .. py:method:: run(attrs: afe.ir.attributes.QNNDequantizeAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.Any], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Executes the operation in floating point :param attrs: AwesomeAttributes associated with this operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:class:: QNNMulOp An abstract class Stores a list of input key names expected to be passed in by the AwesomeNode for developer reference. .. attribute:: input_list ClassVar[Optional[List[InputName]]]. Used as reference when getting inputs from a dictionary. If input_list is None, AFE will skip validating input_list at runtime .. attribute:: observer_behavior How observers are used in a node during calibration .. py:attribute:: input_list :type: ClassVar[afe.ir.attributes.List[afe.ir.defines.InputName]] .. py:attribute:: observer_behavior .. py:attribute:: mul_fn :type: Callable[[afe.ir.attributes.AwesomeAttributes, afe.ir.attributes.np.ndarray, afe.ir.attributes.np.ndarray, float, int, float, int, float, int], afe.ir.attributes.np.ndarray] .. py:method:: run(attrs: afe.ir.attributes.AwesomeAttributes, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.Any], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Executes the operation in floating point :param attrs: AwesomeAttributes associated with this operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:class:: CustomOp An abstract class Stores a list of input key names expected to be passed in by the AwesomeNode for developer reference. .. attribute:: input_list ClassVar[Optional[List[InputName]]]. Used as reference when getting inputs from a dictionary. If input_list is None, AFE will skip validating input_list at runtime .. attribute:: observer_behavior How observers are used in a node during calibration .. py:attribute:: input_list :value: None .. py:attribute:: observer_behavior .. py:attribute:: custom_op_fn :type: Callable[[afe.ir.attributes.CustomOpAttrs, afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.np.ndarray]], afe.ir.attributes.np.ndarray] .. py:attribute:: quant_fn :type: Callable[[afe.ir.attributes.np.ndarray, float, int, int], afe.ir.attributes.np.ndarray] .. py:attribute:: dequant_fn :type: Callable[[afe.ir.attributes.np.ndarray, float, int], afe.ir.attributes.np.ndarray] .. py:method:: run(attrs: afe.ir.attributes.CustomOpAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.Any], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.Union[afe.ir.attributes.np.ndarray, tuple] :classmethod: Executes the operation in floating point :param attrs: AwesomeAttributes associated with this operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:method:: quantize(attrs: afe.ir.attributes.CustomOpAttrs, calib_attrs: afe.ir.attributes.AwesomeCalibAttrs, config: afe.core.configs.QuantizationConfigs, error_reporter: afe.ir.defines.NodeReporter) -> afe.ir.attributes.CustomOpQuantAttrs :classmethod: Compute quantized operator attributes, input quantization, and output quantization from floating-point operator attributes and the result of calibration. When this function is called, calib_attrs.input_quant has the types and quantization of the input values (after the inputs have been transformed by quantization), and calib_attrs.quant holds a type and quantization of the output, which this function may overwrite. The output quantization is computed based on calibration. The output type should not be used. This function must assign to calib_attrs.quant the output type and quantization that this operator has after quantization. It may use the default quantization if appropriate. This function may modify attrs. It should modify attrs if the same attribute class is used for both the floating-point and the quantized operator, which would mean that it's designed to store any quantization information in attrs. This function may modify calib_attrs.input_quant to direct quantization to supply different inputs to this operator. The quantization algorithm will insert quantize or dequantize nodes so that the inputs have the type and quantization that were assigned. An exception will be raised if the input can't be provided by inserting a quantize or dequantize node or leaving the input unchanged. The quantized operator attributes are returned. :param attrs: Floating-point operator attributes. :param quantizer_interface: Quantization-related properties of a node's interface before and after quantization, for use when quantizing the node. :param config: Parameters controlling how to quantize. :param error_reporter: Node reporter of the node to be quantized. :returns: Quantized operator attributes. .. py:method:: run_quant(quant_attrs: afe.ir.attributes.CustomOpQuantAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.np.ndarray], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Execute the operation using quantized arithmetic. :param quant_attrs: Parameters that define the quantized operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:class:: LeakyReluCompositeOp An abstract class Stores a list of input key names expected to be passed in by the AwesomeNode for developer reference. .. attribute:: input_list ClassVar[Optional[List[InputName]]]. Used as reference when getting inputs from a dictionary. If input_list is None, AFE will skip validating input_list at runtime .. attribute:: observer_behavior How observers are used in a node during calibration .. py:attribute:: input_list :type: ClassVar[afe.ir.attributes.List[afe.ir.defines.InputName]] .. py:attribute:: observer_behavior .. py:method:: get_type(attrs: afe.ir.attributes.Union[afe.ir.attributes.LeakyReluAttrs, afe.ir.attributes.LeakyReluCompositeQuantAttrs]) -> afe.ir.tensor_type.NodeType :classmethod: Get the type of this node given its attributes. The parameter should be a QUANT_ATTRS if that data has been created, or an AWESOME_ATTRIBUTES otherwise. :param attrs: Attributes associated with the operator. It is an AWESOME_ATTRIBUTES if quantization has not transformed the node, or a QUANT_ATTRS if it has. :return: The node's type. .. py:method:: run(attrs: afe.ir.attributes.LeakyReluAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.np.ndarray], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Executes the operation in floating point :param attrs: AwesomeAttributes associated with this operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:method:: quantize(attrs: afe.ir.attributes.LeakyReluAttrs, quantizer_interface: afe.ir.quantization_interface.OpQuantInterface, config: afe.core.configs.QuantizationConfigs, error_reporter: afe.ir.defines.NodeReporter) -> afe.ir.attributes.LeakyReluCompositeQuantAttrs :classmethod: Compute quantized operator attributes, input quantization, and output quantization from floating-point operator attributes and the result of calibration. When this function is called, calib_attrs.input_quant has the types and quantization of the input values (after the inputs have been transformed by quantization), and calib_attrs.quant holds a type and quantization of the output, which this function may overwrite. The output quantization is computed based on calibration. The output type should not be used. This function must assign to calib_attrs.quant the output type and quantization that this operator has after quantization. It may use the default quantization if appropriate. This function may modify attrs. It should modify attrs if the same attribute class is used for both the floating-point and the quantized operator, which would mean that it's designed to store any quantization information in attrs. This function may modify calib_attrs.input_quant to direct quantization to supply different inputs to this operator. The quantization algorithm will insert quantize or dequantize nodes so that the inputs have the type and quantization that were assigned. An exception will be raised if the input can't be provided by inserting a quantize or dequantize node or leaving the input unchanged. The quantized operator attributes are returned. :param attrs: Floating-point operator attributes. :param quantizer_interface: Quantization-related properties of a node's interface before and after quantization, for use when quantizing the node. :param config: Parameters controlling how to quantize. :param error_reporter: Node reporter of the node to be quantized. :returns: Quantized operator attributes. .. py:method:: run_quant(quant_attrs: afe.ir.attributes.LeakyReluCompositeQuantAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.np.ndarray], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Execute the operation using quantized arithmetic. :param quant_attrs: Parameters that define the quantized operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:class:: ReluOp An abstract class Stores a list of input key names expected to be passed in by the AwesomeNode for developer reference. .. attribute:: input_list ClassVar[Optional[List[InputName]]]. Used as reference when getting inputs from a dictionary. If input_list is None, AFE will skip validating input_list at runtime .. attribute:: observer_behavior How observers are used in a node during calibration .. py:attribute:: input_list :type: ClassVar[afe.ir.attributes.List[afe.ir.defines.InputName]] .. py:attribute:: observer_behavior .. py:attribute:: relu_fn :type: Callable[[afe.ir.attributes.np.ndarray, int], afe.ir.attributes.np.ndarray] .. py:method:: get_type(attrs: afe.ir.attributes.Union[afe.ir.attributes.ReluAttrs, afe.ir.attributes.ReluQuantAttrs]) -> afe.ir.tensor_type.NodeType :classmethod: Get the type of this node given its attributes. The parameter should be a QUANT_ATTRS if that data has been created, or an AWESOME_ATTRIBUTES otherwise. :param attrs: Attributes associated with the operator. It is an AWESOME_ATTRIBUTES if quantization has not transformed the node, or a QUANT_ATTRS if it has. :return: The node's type. .. py:method:: run(attrs: afe.ir.attributes.ReluAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.np.ndarray], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Executes the operation in floating point :param attrs: AwesomeAttributes associated with this operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:method:: quantize(attrs: afe.ir.attributes.ReluAttrs, quantizer_interface: afe.ir.quantization_interface.OpQuantInterface, config: afe.core.configs.QuantizationConfigs, error_reporter: afe.ir.defines.NodeReporter) -> afe.ir.attributes.Union[afe.ir.attributes.ReluAttrs, afe.ir.attributes.ReluQuantAttrs] :classmethod: Compute quantized operator attributes, input quantization, and output quantization from floating-point operator attributes and the result of calibration. When this function is called, calib_attrs.input_quant has the types and quantization of the input values (after the inputs have been transformed by quantization), and calib_attrs.quant holds a type and quantization of the output, which this function may overwrite. The output quantization is computed based on calibration. The output type should not be used. This function must assign to calib_attrs.quant the output type and quantization that this operator has after quantization. It may use the default quantization if appropriate. This function may modify attrs. It should modify attrs if the same attribute class is used for both the floating-point and the quantized operator, which would mean that it's designed to store any quantization information in attrs. This function may modify calib_attrs.input_quant to direct quantization to supply different inputs to this operator. The quantization algorithm will insert quantize or dequantize nodes so that the inputs have the type and quantization that were assigned. An exception will be raised if the input can't be provided by inserting a quantize or dequantize node or leaving the input unchanged. The quantized operator attributes are returned. :param attrs: Floating-point operator attributes. :param quantizer_interface: Quantization-related properties of a node's interface before and after quantization, for use when quantizing the node. :param config: Parameters controlling how to quantize. :param error_reporter: Node reporter of the node to be quantized. :returns: Quantized operator attributes. .. py:method:: run_quant(quant_attrs: afe.ir.attributes.ReluQuantAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.Any], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Execute the operation using quantized arithmetic. :param quant_attrs: Parameters that define the quantized operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:class:: ClipOp An abstract class Stores a list of input key names expected to be passed in by the AwesomeNode for developer reference. .. attribute:: input_list ClassVar[Optional[List[InputName]]]. Used as reference when getting inputs from a dictionary. If input_list is None, AFE will skip validating input_list at runtime .. attribute:: observer_behavior How observers are used in a node during calibration .. py:attribute:: input_list :type: ClassVar[afe.ir.attributes.List[afe.ir.defines.InputName]] .. py:attribute:: observer_behavior .. py:attribute:: clip_fn :type: Callable[[afe.ir.attributes.ClipAttrs | afe.ir.attributes.ClipQuantAttrs, afe.ir.attributes.np.ndarray], afe.ir.attributes.np.ndarray] .. py:method:: get_type(attrs: afe.ir.attributes.Union[afe.ir.attributes.ClipAttrs, afe.ir.attributes.ClipQuantAttrs]) -> afe.ir.tensor_type.NodeType :classmethod: Get the type of this node given its attributes. The parameter should be a QUANT_ATTRS if that data has been created, or an AWESOME_ATTRIBUTES otherwise. :param attrs: Attributes associated with the operator. It is an AWESOME_ATTRIBUTES if quantization has not transformed the node, or a QUANT_ATTRS if it has. :return: The node's type. .. py:method:: run(attrs: afe.ir.attributes.ClipAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.Any], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.Any :classmethod: Executes the operation in floating point :param attrs: AwesomeAttributes associated with this operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:method:: quantize(attrs: afe.ir.attributes.ClipAttrs, quantizer_interface: afe.ir.quantization_interface.OpQuantInterface, config: afe.core.configs.QuantizationConfigs, error_reporter: afe.ir.defines.NodeReporter) -> afe.ir.attributes.ClipAttrs | afe.ir.attributes.ClipQuantAttrs :classmethod: Compute quantized operator attributes, input quantization, and output quantization from floating-point operator attributes and the result of calibration. When this function is called, calib_attrs.input_quant has the types and quantization of the input values (after the inputs have been transformed by quantization), and calib_attrs.quant holds a type and quantization of the output, which this function may overwrite. The output quantization is computed based on calibration. The output type should not be used. This function must assign to calib_attrs.quant the output type and quantization that this operator has after quantization. It may use the default quantization if appropriate. This function may modify attrs. It should modify attrs if the same attribute class is used for both the floating-point and the quantized operator, which would mean that it's designed to store any quantization information in attrs. This function may modify calib_attrs.input_quant to direct quantization to supply different inputs to this operator. The quantization algorithm will insert quantize or dequantize nodes so that the inputs have the type and quantization that were assigned. An exception will be raised if the input can't be provided by inserting a quantize or dequantize node or leaving the input unchanged. The quantized operator attributes are returned. :param attrs: Floating-point operator attributes. :param quantizer_interface: Quantization-related properties of a node's interface before and after quantization, for use when quantizing the node. :param config: Parameters controlling how to quantize. :param error_reporter: Node reporter of the node to be quantized. :returns: Quantized operator attributes. .. py:method:: run_quant(attrs: afe.ir.attributes.ClipAttrs | afe.ir.attributes.ClipQuantAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.Any], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Execute the operation using quantized arithmetic. :param quant_attrs: Parameters that define the quantized operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:class:: BatchMatmulOp Standard batch matmul operator where arguments to batch matmul operation are outputs of two different nodes. .. py:attribute:: input_list :type: ClassVar[afe.ir.attributes.List[afe.ir.defines.InputName]] .. py:attribute:: observer_behavior .. py:class:: UnaryBatchMatmulOp Special case of batch matmul operator where both arguments to batch matmul operation are output of a same node. .. py:attribute:: input_list :type: ClassVar[afe.ir.attributes.List[afe.ir.defines.InputName]] .. py:attribute:: observer_behavior .. py:class:: LayerNormOp An abstract class Stores a list of input key names expected to be passed in by the AwesomeNode for developer reference. .. attribute:: input_list ClassVar[Optional[List[InputName]]]. Used as reference when getting inputs from a dictionary. If input_list is None, AFE will skip validating input_list at runtime .. attribute:: observer_behavior How observers are used in a node during calibration .. py:attribute:: input_list :type: ClassVar[afe.ir.attributes.List[afe.ir.defines.InputName]] .. py:attribute:: observer_behavior .. py:attribute:: layer_norm_fn :type: Callable[[afe.ir.attributes.LayerNormAttrs, afe.ir.attributes.np.ndarray], afe.ir.attributes.np.ndarray] .. py:method:: get_type(attrs: afe.ir.attributes.LayerNormAttrs | afe.ir.attributes.LayerNormQuantAttrs) -> afe.ir.tensor_type.NodeType :classmethod: Get the type of this node given its attributes. The parameter should be a QUANT_ATTRS if that data has been created, or an AWESOME_ATTRIBUTES otherwise. :param attrs: Attributes associated with the operator. It is an AWESOME_ATTRIBUTES if quantization has not transformed the node, or a QUANT_ATTRS if it has. :return: The node's type. .. py:method:: run(attrs: afe.ir.attributes.LayerNormAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.np.ndarray], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Executes the operation in floating point :param attrs: AwesomeAttributes associated with this operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:method:: quantize(attrs: afe.ir.attributes.LayerNormAttrs, quantizer_interface: afe.ir.quantization_interface.OpQuantInterface, config: afe.core.configs.QuantizationConfigs, error_reporter: afe.ir.defines.NodeReporter) -> afe.ir.attributes.LayerNormAttrs | afe.ir.attributes.LayerNormQuantAttrs :classmethod: Compute quantized operator attributes, input quantization, and output quantization from floating-point operator attributes and the result of calibration. When this function is called, calib_attrs.input_quant has the types and quantization of the input values (after the inputs have been transformed by quantization), and calib_attrs.quant holds a type and quantization of the output, which this function may overwrite. The output quantization is computed based on calibration. The output type should not be used. This function must assign to calib_attrs.quant the output type and quantization that this operator has after quantization. It may use the default quantization if appropriate. This function may modify attrs. It should modify attrs if the same attribute class is used for both the floating-point and the quantized operator, which would mean that it's designed to store any quantization information in attrs. This function may modify calib_attrs.input_quant to direct quantization to supply different inputs to this operator. The quantization algorithm will insert quantize or dequantize nodes so that the inputs have the type and quantization that were assigned. An exception will be raised if the input can't be provided by inserting a quantize or dequantize node or leaving the input unchanged. The quantized operator attributes are returned. :param attrs: Floating-point operator attributes. :param quantizer_interface: Quantization-related properties of a node's interface before and after quantization, for use when quantizing the node. :param config: Parameters controlling how to quantize. :param error_reporter: Node reporter of the node to be quantized. :returns: Quantized operator attributes. .. py:method:: run_quant(quant_attrs: afe.ir.attributes.LayerNormQuantAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.np.ndarray], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Execute the operation using quantized arithmetic. :param quant_attrs: Parameters that define the quantized operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:method:: calibrate(attrs: AWESOME_ATTRS, calib_attrs: afe.ir.attributes.AwesomeCalibAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.Any], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.Any :classmethod: Layer Norm calibration method. Executes default calibration to get results of LN operation in floating point. Additionally, calculate intermediate results and update the observers for intermediate values. :param attrs: AwesomeAttributes associated with this operation :param calib_attrs: AwesomeCalibAttrs associated with operation's node. :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Parameters controlling how to calibrate. :return: Output tensor(s) whose type is dependent on the subclass. .. py:class:: InstanceNormOp An abstract class Stores a list of input key names expected to be passed in by the AwesomeNode for developer reference. .. attribute:: input_list ClassVar[Optional[List[InputName]]]. Used as reference when getting inputs from a dictionary. If input_list is None, AFE will skip validating input_list at runtime .. attribute:: observer_behavior How observers are used in a node during calibration .. py:attribute:: input_list :type: ClassVar[afe.ir.attributes.List[afe.ir.defines.InputName]] .. py:attribute:: observer_behavior .. py:attribute:: instance_norm_fn :type: Callable[[afe.ir.attributes.np.ndarray], afe.ir.attributes.np.ndarray] .. py:method:: get_type(attrs: afe.ir.attributes.InstanceNormAttrs | afe.ir.attributes.InstanceNormQuantAttrs) -> afe.ir.tensor_type.NodeType :classmethod: Get the type of this node given its attributes. The parameter should be a QUANT_ATTRS if that data has been created, or an AWESOME_ATTRIBUTES otherwise. :param attrs: Attributes associated with the operator. It is an AWESOME_ATTRIBUTES if quantization has not transformed the node, or a QUANT_ATTRS if it has. :return: The node's type. .. py:method:: run(attrs: afe.ir.attributes.InstanceNormAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.np.ndarray], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Executes the operation in floating point :param attrs: AwesomeAttributes associated with this operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:method:: quantize(attrs: afe.ir.attributes.InstanceNormAttrs, quantizer_interface: afe.ir.quantization_interface.OpQuantInterface, config: afe.core.configs.QuantizationConfigs, error_reporter: afe.ir.defines.NodeReporter) -> afe.ir.attributes.InstanceNormAttrs | afe.ir.attributes.InstanceNormQuantAttrs :classmethod: Compute quantized operator attributes, input quantization, and output quantization from floating-point operator attributes and the result of calibration. When this function is called, calib_attrs.input_quant has the types and quantization of the input values (after the inputs have been transformed by quantization), and calib_attrs.quant holds a type and quantization of the output, which this function may overwrite. The output quantization is computed based on calibration. The output type should not be used. This function must assign to calib_attrs.quant the output type and quantization that this operator has after quantization. It may use the default quantization if appropriate. This function may modify attrs. It should modify attrs if the same attribute class is used for both the floating-point and the quantized operator, which would mean that it's designed to store any quantization information in attrs. This function may modify calib_attrs.input_quant to direct quantization to supply different inputs to this operator. The quantization algorithm will insert quantize or dequantize nodes so that the inputs have the type and quantization that were assigned. An exception will be raised if the input can't be provided by inserting a quantize or dequantize node or leaving the input unchanged. The quantized operator attributes are returned. :param attrs: Floating-point operator attributes. :param quantizer_interface: Quantization-related properties of a node's interface before and after quantization, for use when quantizing the node. :param config: Parameters controlling how to quantize. :param error_reporter: Node reporter of the node to be quantized. :returns: Quantized operator attributes. .. py:method:: run_quant(quant_attrs: afe.ir.attributes.InstanceNormQuantAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.np.ndarray], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Execute the operation using quantized arithmetic. :param quant_attrs: Parameters that define the quantized operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:class:: RMSNormOp RMSNorm Operator is implemented as: RMSNormCore(x, axis, epsilon) = x / Sqrt(ReduceMean(x ** 2, axis, keepdims=True) + epsilon) RMSNorm(x, axis, epsilon, weight) = RMSNormCore(x, axis, epsilon) * weight Multiplication with weight on MLA is implemented by using depth-wise convolution. .. py:attribute:: input_list :type: ClassVar[afe.ir.attributes.List[afe.ir.defines.InputName]] .. py:attribute:: observer_behavior .. py:attribute:: rms_norm_fn :type: Callable[[afe.ir.attributes.np.ndarray, afe.ir.attributes.RMSNormAttrs, afe.ir.operation_functions.RunMode], afe.ir.attributes.np.ndarray] .. py:attribute:: dwconv_op :type: ConvAddActivationOp .. py:method:: get_type(attrs: afe.ir.attributes.Union[afe.ir.attributes.RMSNormAttrs, afe.ir.attributes.RMSNormQuantAttrs]) -> afe.ir.tensor_type.NodeType :classmethod: Get the type of this node given its attributes. The parameter should be a QUANT_ATTRS if that data has been created, or an AWESOME_ATTRIBUTES otherwise. :param attrs: Attributes associated with the operator. It is an AWESOME_ATTRIBUTES if quantization has not transformed the node, or a QUANT_ATTRS if it has. :return: The node's type. .. py:method:: run(attrs: afe.ir.attributes.RMSNormAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.np.ndarray], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Executes the operation in floating point :param attrs: AwesomeAttributes associated with this operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:method:: quant_rms_norm_core(attrs: afe.ir.attributes.RMSNormAttrs, quantizer_interface: afe.ir.quantization_interface.OpQuantInterface, config: afe.core.configs.QuantizationConfigs, error_reporter: afe.ir.defines.NodeReporter) -> afe.ir.attributes.RMSNormAttrs | afe.ir.attributes.RMSNormCoreQuantAttrs :classmethod: Quantize rms norm core part. .. py:method:: quantize(attrs: afe.ir.attributes.RMSNormAttrs, quantizer_interface: afe.ir.quantization_interface.OpQuantInterface, config: afe.core.configs.QuantizationConfigs, error_reporter: afe.ir.defines.NodeReporter) -> afe.ir.attributes.RMSNormAttrs | afe.ir.attributes.RMSNormQuantAttrs :classmethod: Quantize RMS norm core part and depth-wise conv part separately. .. py:method:: run_quant(quant_attrs: afe.ir.attributes.RMSNormQuantAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.np.ndarray], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Execute the operation using quantized arithmetic. :param quant_attrs: Parameters that define the quantized operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:method:: calibrate(attrs: afe.ir.attributes.RMSNormAttrs, calib_attrs: afe.ir.attributes.AwesomeCalibAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.Any], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.Any :classmethod: RMS Norm calibration method. Executes default calibration to get results of RMSNorm operation in floating point. Additionally, calculate intermediate results and update the observers for intermediate values. .. py:class:: SliceConcatOp This composite node uses infrastructure from StridedSliceOp and ConcatenateOp run. .. py:attribute:: input_list :type: ClassVar[afe.ir.attributes.List[afe.ir.defines.InputName]] .. py:attribute:: observer_behavior .. py:method:: get_type(attrs: afe.ir.attributes.Union[afe.ir.attributes.SliceConcatAttrs, afe.ir.attributes.SliceConcatQuantAttrs]) -> afe.ir.tensor_type.NodeType :classmethod: Get the type of this node given its attributes. The parameter should be a QUANT_ATTRS if that data has been created, or an AWESOME_ATTRIBUTES otherwise. :param attrs: Attributes associated with the operator. It is an AWESOME_ATTRIBUTES if quantization has not transformed the node, or a QUANT_ATTRS if it has. :return: The node's type. .. py:method:: run(attrs: afe.ir.attributes.SliceConcatAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.np.ndarray], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Executes the operation in floating point :param attrs: AwesomeAttributes associated with this operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:method:: quantize(attrs: afe.ir.attributes.SliceConcatAttrs, quantizer_interface: afe.ir.quantization_interface.OpQuantInterface, config: afe.core.configs.QuantizationConfigs, error_reporter: afe.ir.defines.NodeReporter) -> afe.ir.attributes.Union[afe.ir.attributes.SliceConcatAttrs, afe.ir.attributes.SliceConcatQuantAttrs] :classmethod: Compute quantized operator attributes, input quantization, and output quantization from floating-point operator attributes and the result of calibration. When this function is called, calib_attrs.input_quant has the types and quantization of the input values (after the inputs have been transformed by quantization), and calib_attrs.quant holds a type and quantization of the output, which this function may overwrite. The output quantization is computed based on calibration. The output type should not be used. This function must assign to calib_attrs.quant the output type and quantization that this operator has after quantization. It may use the default quantization if appropriate. This function may modify attrs. It should modify attrs if the same attribute class is used for both the floating-point and the quantized operator, which would mean that it's designed to store any quantization information in attrs. This function may modify calib_attrs.input_quant to direct quantization to supply different inputs to this operator. The quantization algorithm will insert quantize or dequantize nodes so that the inputs have the type and quantization that were assigned. An exception will be raised if the input can't be provided by inserting a quantize or dequantize node or leaving the input unchanged. The quantized operator attributes are returned. :param attrs: Floating-point operator attributes. :param quantizer_interface: Quantization-related properties of a node's interface before and after quantization, for use when quantizing the node. :param config: Parameters controlling how to quantize. :param error_reporter: Node reporter of the node to be quantized. :returns: Quantized operator attributes. .. py:method:: run_quant(quant_attrs: afe.ir.attributes.SliceConcatQuantAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.np.ndarray], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Execute the operation using quantized arithmetic. :param quant_attrs: Parameters that define the quantized operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:class:: HardSigmoidOp An abstract class Stores a list of input key names expected to be passed in by the AwesomeNode for developer reference. .. attribute:: input_list ClassVar[Optional[List[InputName]]]. Used as reference when getting inputs from a dictionary. If input_list is None, AFE will skip validating input_list at runtime .. attribute:: observer_behavior How observers are used in a node during calibration .. py:attribute:: input_list :type: ClassVar[afe.ir.attributes.List[afe.ir.defines.InputName]] .. py:attribute:: observer_behavior .. py:attribute:: hard_sigmoid_fn :type: Callable[[afe.ir.attributes.np.ndarray], afe.ir.attributes.np.ndarray] .. py:method:: get_type(attrs: afe.ir.attributes.Union[afe.ir.attributes.HardSigmoidAttrs, afe.ir.attributes.UDFQuantAttrs]) -> afe.ir.tensor_type.NodeType :classmethod: Get the type of this node given its attributes. The parameter should be a QUANT_ATTRS if that data has been created, or an AWESOME_ATTRIBUTES otherwise. :param attrs: Attributes associated with the operator. It is an AWESOME_ATTRIBUTES if quantization has not transformed the node, or a QUANT_ATTRS if it has. :return: The node's type. .. py:method:: run(attrs: afe.ir.attributes.HardSigmoidAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.np.ndarray], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Executes the operation in floating point :param attrs: AwesomeAttributes associated with this operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass. .. py:method:: quantize(attrs: afe.ir.attributes.HardSigmoidAttrs, quantizer_interface: afe.ir.quantization_interface.OpQuantInterface, configs: afe.core.configs.QuantizationConfigs, error_reporter: afe.ir.defines.NodeReporter) -> afe.ir.attributes.Union[afe.ir.attributes.HardSigmoidAttrs, afe.ir.attributes.UDFQuantAttrs] :classmethod: Compute quantized operator attributes, input quantization, and output quantization from floating-point operator attributes and the result of calibration. When this function is called, calib_attrs.input_quant has the types and quantization of the input values (after the inputs have been transformed by quantization), and calib_attrs.quant holds a type and quantization of the output, which this function may overwrite. The output quantization is computed based on calibration. The output type should not be used. This function must assign to calib_attrs.quant the output type and quantization that this operator has after quantization. It may use the default quantization if appropriate. This function may modify attrs. It should modify attrs if the same attribute class is used for both the floating-point and the quantized operator, which would mean that it's designed to store any quantization information in attrs. This function may modify calib_attrs.input_quant to direct quantization to supply different inputs to this operator. The quantization algorithm will insert quantize or dequantize nodes so that the inputs have the type and quantization that were assigned. An exception will be raised if the input can't be provided by inserting a quantize or dequantize node or leaving the input unchanged. The quantized operator attributes are returned. :param attrs: Floating-point operator attributes. :param quantizer_interface: Quantization-related properties of a node's interface before and after quantization, for use when quantizing the node. :param config: Parameters controlling how to quantize. :param error_reporter: Node reporter of the node to be quantized. :returns: Quantized operator attributes. .. py:method:: run_quant(quant_attrs: afe.ir.attributes.UDFQuantAttrs, input_dict: afe.ir.attributes.Dict[afe.ir.defines.InputName, afe.ir.attributes.np.ndarray], config: afe.core.configs.RunConfigs) -> afe.ir.attributes.np.ndarray :classmethod: Execute the operation using quantized arithmetic. :param quant_attrs: Parameters that define the quantized operation :param input_dict: Dictionary of names (eg. 'weights' 'data') to numpy arrays :param config: Configuration parameters for how to run the network :return: Output tensor(s) whose type is dependent on the subclass.