pytorch
23223402 - [quant][pt2e] Add Support for DerivedQuantizationSpec (#102282)

Commit
1 year ago
[quant][pt2e] Add Support for DerivedQuantizationSpec (#102282) Summary: ``` """ 4. DerivedQuantizationSpec this is the quantization spec for the Tensors whose quantization parameters are derived from other Tensors """ class DerivedQuantizationSpec(QuantizationSpecBase): # specifies which Tensors the quantization parameters are derived from # this can either be an edge from argument to node, or a node derived_from: List[EdgeOrNode] derive_qparams_fn: Callabale[List[ObserverOrFakeQuantize], Tuple[Tensor, Tensor]] ... ``` Test Plan: ``` buck2 test mode/opt caffe2/test:quantization_pt2e -- 'caffe2/test:quantization_pt2e' buck2 test mode/opt caffe2/test:quantization_pt2e -- --exact 'caffe2/test:quantization_pt2e - test_resnet18_with_quantizer_api (quantization.pt2e.test_quantize_pt2e.TestQuantizePT2EModels)' ``` Reviewed By: kimishpatel Differential Revision: D46097855 Pull Request resolved: https://github.com/pytorch/pytorch/pull/102282 Approved by: https://github.com/andrewor14
Author
Committer
Parents
Loading