File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
torchao/quantization/pt2e Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 1111if TORCH_VERSION_AT_LEAST_2_7 :
1212 from .constant_fold import constant_fold
1313
14+ from typing import Union
15+
1416from torch .fx import GraphModule , Node
1517from torch .fx .passes .infra .pass_manager import PassManager
1618
3941
4042def prepare_pt2e (
4143 model : GraphModule ,
42- quantizer : Quantizer ,
44+ quantizer : Union [ Quantizer , torch . ao . quantization . quantizer . quantizer . Quantizer ] ,
4345) -> GraphModule :
4446 """Prepare a model for post training quantization
4547
@@ -127,7 +129,7 @@ def calibrate(model, data_loader):
127129
128130def prepare_qat_pt2e (
129131 model : GraphModule ,
130- quantizer : Quantizer ,
132+ quantizer : Union [ Quantizer , torch . ao . quantization . quantizer . quantizer . Quantizer ] ,
131133) -> GraphModule :
132134 """Prepare a model for quantization aware training
133135
You can’t perform that action at this time.
0 commit comments