Cjian/per channels not working (#13038)

**Description**: This fix the bug where per_channel quantization isn't
working when axis == 0
This commit is contained in:
Jian Chen 2022-09-21 16:24:23 -04:00 committed by GitHub
parent 6248b69795
commit 051a0a67a5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -255,7 +255,7 @@ class QDQQuantizer(ONNXQuantizer):
def _add_qdq_pair_for_initializer(self, weight_proto, tensor_type, axis=None):
weight_name = weight_proto.name
if axis:
if axis is not None:
if self.opset_version < 13:
raise ValueError("Per-Channel support with QDQ format requires onnx opset version 13 or above.")
q_weight_name, zp_name, scale_name = self.quantize_weight_per_channel(