MCPcopy Create free account
hub / github.com/pytorch/executorch / annotate

Method annotate

backends/qualcomm/quantizer/annotators/htp_rules.py:685–714  ·  view source on GitHub ↗
(node: Node, quantization_config: QuantizationConfig)

Source from the content-addressed store, hash-verified

683class GroupNorm(GeneralOpDef):
684 @staticmethod
685 def annotate(node: Node, quantization_config: QuantizationConfig) -> None:
686 act_node = node.args[0]
687 weight_node = node.args[2]
688 bias_node = None
689 if len(node.args) > 2:
690 bias_node = node.args[3]
691
692 if _is_annotated([node]):
693 return
694
695 annotate_input_qspec_map(
696 node,
697 act_node,
698 quantization_config.input_activation,
699 )
700 annotate_input_qspec_map(
701 node,
702 weight_node,
703 quantization_config.weight,
704 )
705 nodes_to_mark_annotated = [node, weight_node]
706 if bias_node:
707 annotate_input_qspec_map(
708 node,
709 bias_node,
710 quantization_config.bias,
711 )
712 nodes_to_mark_annotated.append(bias_node)
713 annotate_output_qspec(node, quantization_config.output_activation)
714 _mark_nodes_as_annotated(nodes_to_mark_annotated)
715
716
717@register_annotator(

Callers

nothing calls this directly

Calls 4

_is_annotatedFunction · 0.90
annotate_output_qspecFunction · 0.90
_mark_nodes_as_annotatedFunction · 0.90
appendMethod · 0.45

Tested by

no test coverage detected