(node: Node, quant_config: QuantizationConfig)
| 551 | # CASE 4: One value input + one index input with Shared Quant |
| 552 | @register_annotator([torch.ops.aten.index.Tensor]) |
| 553 | def annotate_index(node: Node, quant_config: QuantizationConfig) -> None: |
| 554 | input_qspec_map = {} |
| 555 | input = node.args[0] |
| 556 | assert isinstance(input, Node) |
| 557 | |
| 558 | if _is_annotated([node]) or not _is_float_tensor(input): |
| 559 | return |
| 560 | |
| 561 | # get QuantAnnt from the input path |
| 562 | shared_quant_node = _get_quantization_annotation(input) |
| 563 | if shared_quant_node: |
| 564 | shared_qspec = SharedQuantizationSpec((shared_quant_node, node)) |
| 565 | input_qspec_map[input] = quant_config.input_activation |
| 566 | |
| 567 | # sharing QuantAnnot with the parent |
| 568 | node.meta["quantization_annotation"] = QuantizationAnnotation( |
| 569 | input_qspec_map=input_qspec_map, |
| 570 | output_qspec=shared_qspec, |
| 571 | _annotated=True, |
| 572 | ) |
| 573 | |
| 574 | |
| 575 | # CASE 5 input + index + value & output with Shared Quant |
nothing calls this directly
no test coverage detected