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

Function annotate_embedding

backends/samsung/quantizer/annotator.py:682–694  ·  view source on GitHub ↗
(node: Node, quant_config: QuantizationConfig)

Source from the content-addressed store, hash-verified

680# CASE 8: embedding
681@register_annotator([torch.ops.aten.embedding.default])
682def annotate_embedding(node: Node, quant_config: QuantizationConfig) -> None:
683 input_qspec_map = {}
684 weight = node.args[0]
685 if _is_annotated([node]) or not _is_float_tensor(weight):
686 return
687
688 input_qspec_map[weight] = quant_config.input_activation
689
690 node.meta["quantization_annotation"] = QuantizationAnnotation(
691 input_qspec_map=input_qspec_map,
692 output_qspec=quant_config.output_activation,
693 _annotated=True,
694 )
695
696
697# CASE 9: Concat & Stack

Callers

nothing calls this directly

Calls 2

_is_annotatedFunction · 0.70
_is_float_tensorFunction · 0.70

Tested by

no test coverage detected