Skip to content

Commit 11f3dbf

Browse files
authored
fix onnxrt backend auto quant (#1301)
1 parent 6caa1ac commit 11f3dbf

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

neural_compressor/adaptor/onnxrt.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -609,17 +609,17 @@ def query_fw_capability(self, model):
609609
for precision in precisions:
610610
if precision == 'fp16' and self.device == 'cpu' and os.getenv('FORCE_FP16') != '1':
611611
continue
612-
if precision in self.query_handler.get_quantization_capability():
613-
special_config_types = list(self.query_handler.get_quantization_capability() \
612+
if precision in query.get_quantization_capability():
613+
special_config_types = list(query.get_quantization_capability() \
614614
[precision].keys())
615-
default_config = self.query_handler.get_quantization_capability() \
615+
default_config = query.get_quantization_capability() \
616616
[precision]['default']
617617
else:
618618
special_config_types = {}
619619
default_config = {'weight': {'dtype': precision},
620620
'activation': {'dtype': precision}}
621-
optypes = self.query_handler.get_op_types_by_precision(precision) if \
622-
self.query_handler.get_op_types_by_precision(precision) != ['*'] else \
621+
optypes = query.get_op_types_by_precision(precision) if \
622+
query.get_op_types_by_precision(precision) != ['*'] else \
623623
optype_wise.keys()
624624
for op in optypes:
625625
if op not in quantizable_optype:
@@ -628,7 +628,7 @@ def query_fw_capability(self, model):
628628
op_capability = copy.deepcopy(default_config)
629629
else:
630630
op_capability = copy.deepcopy(
631-
self.query_handler.get_quantization_capability()[precision][op])
631+
query.get_quantization_capability()[precision][op])
632632

633633
if precision in ['int8', 'uint8']:
634634
if self.static:

0 commit comments

Comments
 (0)