Return True if the node's output is annotated. Args: node (Node): FX node to inspect. Returns: bool: True if annotated and an output qspec is present.
(node: Node)
| 59 | |
| 60 | |
| 61 | def is_output_annotated(node: Node) -> bool: |
| 62 | """Return True if the node's output is annotated. |
| 63 | |
| 64 | Args: |
| 65 | node (Node): FX node to inspect. |
| 66 | |
| 67 | Returns: |
| 68 | bool: True if annotated and an output qspec is present. |
| 69 | |
| 70 | """ |
| 71 | if Q_ANNOTATION_KEY in node.meta: |
| 72 | annotation = cast(QuantizationAnnotation, node.meta[Q_ANNOTATION_KEY]) |
| 73 | return annotation._annotated and annotation.output_qspec is not None |
| 74 | else: |
| 75 | return False |
| 76 | |
| 77 | |
| 78 | def mark_node_as_annotated(node: Node) -> None: |
no outgoing calls
no test coverage detected