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

Function _annotate_nodes

backends/example/example_operators/utils.py:23–34  ·  view source on GitHub ↗
(node_tuples, quant_spec, input_node=False)

Source from the content-addressed store, hash-verified

21
22
23def _annotate_nodes(node_tuples, quant_spec, input_node=False):
24 for node_tuple in node_tuples:
25 node = node_tuple[0]
26 quant_annotation = node.meta.get(
27 Q_ANNOTATION_KEY, QuantizationAnnotation(_annotated=True)
28 )
29 if input_node:
30 input_node = node_tuple[1]
31 quant_annotation.input_qspec_map[input_node] = quant_spec
32 else:
33 quant_annotation.output_qspec = quant_spec
34 node.meta[Q_ANNOTATION_KEY] = quant_annotation

Callers 7

_annotate_linearFunction · 0.90
_annotate_conv_reluFunction · 0.90
_annotate_dropoutFunction · 0.90
_annotate_meanFunction · 0.90
_annotate_addFunction · 0.90
_annotate_flattenFunction · 0.90
_annotate_conv2dFunction · 0.90

Calls 1

getMethod · 0.45

Tested by

no test coverage detected