Skip to content

Commit

Permalink
Fix too strict assert in onnx_quantizer.py
Browse files Browse the repository at this point in the history
  • Loading branch information
xadupre committed Oct 1, 2024
1 parent ffca096 commit 1339067
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion onnxruntime/python/tools/quantization/onnx_quantizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -942,7 +942,7 @@ def _dequantize_value(self, value_name):
self.model.model.producer_name == "onnx-quantizer" and scale_init is not None
):
# axis is not specified so scale_init must be a scalar.
assert onnx.numpy_helper.to_array(scale_init).size == 1
assert scale_init is None or onnx.numpy_helper.to_array(scale_init).size == 1

dqlinear_name = value_name + "_DequantizeLinear"
dqlinear_node = self.model.find_node_by_name(dqlinear_name, self.new_nodes, self.model.graph())
Expand Down

0 comments on commit 1339067

Please sign in to comment.