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

Function is_annotated

backends/arm/quantizer/arm_quantizer_utils.py:45–58  ·  view source on GitHub ↗

Return True if the node is annotated. Args: node (Node): FX node to inspect. Returns: bool: True if ``Q_ANNOTATION_KEY`` exists and ``_annotated`` is set.

(node: Node)

Source from the content-addressed store, hash-verified

43
44
45def is_annotated(node: Node) -> bool:
46 """Return True if the node is annotated.
47
48 Args:
49 node (Node): FX node to inspect.
50
51 Returns:
52 bool: True if ``Q_ANNOTATION_KEY`` exists and ``_annotated`` is set.
53
54 """
55 return (
56 Q_ANNOTATION_KEY in node.meta
57 and cast(QuantizationAnnotation, node.meta[Q_ANNOTATION_KEY])._annotated
58 )
59
60
61def is_output_annotated(node: Node) -> bool:

Callers 6

_annotate_ioMethod · 0.90
validate_nodeFunction · 0.90
check_annotationFunction · 0.90
_annotate_inputFunction · 0.70
_annotate_outputFunction · 0.70
annotate_graphFunction · 0.70

Calls

no outgoing calls

Tested by 2

validate_nodeFunction · 0.72
check_annotationFunction · 0.72