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)
| 43 | |
| 44 | |
| 45 | def 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 | |
| 61 | def is_output_annotated(node: Node) -> bool: |
no outgoing calls