(node: torch.fx.Node, qspec: QuantizationSpec | None)
| 88 | |
| 89 | |
| 90 | def validate_output(node: torch.fx.Node, qspec: QuantizationSpec | None): |
| 91 | if qspec is None: |
| 92 | return |
| 93 | users = list(node.users) |
| 94 | assert len(users) == 1, f"Node {node} should have exactly one user" |
| 95 | assert ( |
| 96 | users[0].target == Q_PER_TENSOR |
| 97 | ), f"Output node {users[0]} is not quantized as expected" |
| 98 | validate_per_tensor_quant(users[0], qspec) |
| 99 | |
| 100 | |
| 101 | def validate_node( |
no test coverage detected