Skip to content

Commit 1e71c92

Browse files
Merge pull request #1235 from onnx/tom/opset13qdq
Fix quant and dequant for opset 13
2 parents 155f542 + b099a24 commit 1e71c92

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tf2onnx/rewriter/quantization_ops_rewriter.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ def create_qdq_nodes(g, match_results):
6464
zero_point = zero_point[0]
6565
attrs = {}
6666
else:
67-
utils.make_sure(axis, "Axis must be specified for per channel quantization")
67+
utils.make_sure(axis and axis != -1, "Axis must be specified for per channel quantization")
68+
utils.make_sure(g.opset >= 13, "Opset >= 13 is required for per channel quantization")
6869
attrs = {'axis': axis}
6970

7071
# Split it into QuantizeLinear and DequantizeLinear and remove the QDQ node reference

0 commit comments

Comments
 (0)