mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-06-04 23:59:56 +00:00
quantization tool better support operator when subgraph is enabled (#9463)
* Fix is_valid_quantize_weight recursive issue when enable subgraph. * some clear
This commit is contained in:
parent
33ef1d7700
commit
c1b0f924b7
1 changed files with 5 additions and 1 deletions
|
|
@ -320,7 +320,11 @@ class ONNXQuantizer:
|
|||
|
||||
def is_valid_quantize_weight(self, weight_name):
|
||||
weight = find_by_name(weight_name, self.model.initializer())
|
||||
return weight is not None and weight.data_type == onnx_proto.TensorProto.FLOAT
|
||||
if weight is not None:
|
||||
return weight.data_type == onnx_proto.TensorProto.FLOAT
|
||||
if (not self.enable_subgraph_quantization) or (self.parent is None):
|
||||
return False
|
||||
return self.parent.is_valid_quantize_weight(weight_name)
|
||||
|
||||
def _get_dynamic_input_quantization_params(self, input_name, nodes_list, qType):
|
||||
'''
|
||||
|
|
|
|||
Loading…
Reference in a new issue