mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-25 19:48:11 +00:00
fix quantization errors of ConvTranspose with per_channel=True (#19996)
### Description <!-- Describe your changes. --> - update axis value for per_channel quantization of QDQConv - we should use `axis=1` for ConvTranspose operator. ### Motivation and Context <!-- - Why is this change required? What problem does it solve? - If it fixes an open issue, please link to the issue here. --> - this PR fixes https://github.com/microsoft/onnxruntime/issues/19694, which I have opened
This commit is contained in:
parent
f3a864217f
commit
00244ea143
1 changed files with 2 additions and 1 deletions
|
|
@ -247,7 +247,8 @@ class QDQConv(QDQOperatorBase):
|
|||
self.quantizer.quantize_activation_tensor(node.output[0])
|
||||
|
||||
if self.quantizer.is_per_channel():
|
||||
self.quantizer.quantize_weight_tensor_per_channel(node.input[1], 0)
|
||||
axis = 0 if node.op_type == "Conv" else 1
|
||||
self.quantizer.quantize_weight_tensor_per_channel(node.input[1], axis)
|
||||
else:
|
||||
self.quantizer.quantize_weight_tensor(node.input[1])
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue