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

Function _get_quantization_annotation

backends/samsung/quantizer/annotator.py:231–247  ·  view source on GitHub ↗
(node: Node)

Source from the content-addressed store, hash-verified

229
230# getting QuantAnnot though the first input
231def _get_quantization_annotation(node: Node):
232 if node.op == "placeholder":
233 return False
234 elif "quantization_annotation" in node.meta:
235 return node
236 elif node.args == ():
237 return False
238 elif isinstance(node.args[0], Node):
239 return _get_quantization_annotation(node.args[0])
240 elif isinstance(node.args[0], list):
241 # for cat, concatenate and stack
242 if isinstance(node.args[0][0], Node):
243 return _get_quantization_annotation(node.args[0][0])
244 else:
245 return False
246 else:
247 return False
248
249
250# CASE 2-2: two input case with Shared Quant

Callers 8

annotate_indexFunction · 0.85
annotate_index_putFunction · 0.85
annotate_unbindFunction · 0.85
annotate_conv2dFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected