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

Function annotate

backends/mediatek/quantizer/annotator.py:32–44  ·  view source on GitHub ↗
(graph: Graph, quant_config: QuantizationConfig)

Source from the content-addressed store, hash-verified

30
31
32def annotate(graph: Graph, quant_config: QuantizationConfig) -> None:
33 # Pattern annotation
34 _annotate_rmsnorm_pattern(graph, quant_config)
35 _annotate_fused_activation_pattern(graph, quant_config)
36
37 # Per-op annotation
38 for node in graph.nodes:
39 if node.op == "placeholder":
40 annotate_placeholder(node, quant_config)
41 elif node.op == "call_function":
42 annotate_func = OP_TO_ANNOTATOR.get(node.target, None)
43 if annotate_func is not None:
44 annotate_func(node, quant_config)
45
46
47def register_annotator(ops: List[OpOverload]):

Callers 1

_annotateMethod · 0.70

Calls 4

annotate_placeholderFunction · 0.70
getMethod · 0.45

Tested by

no test coverage detected