Skip to content

Commit

Permalink
fix quantization errors of ConvTranspose with per_channel=True
Browse files Browse the repository at this point in the history
  • Loading branch information
mo-ja committed Feb 28, 2024
1 parent 8f5c79c commit 9f42bf8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion onnxruntime/python/tools/quantization/operators/conv.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,8 @@ def quantize(self):
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])

Expand Down

0 comments on commit 9f42bf8

Please sign in to comment.