未验证 提交 9ffb43be 编写于 作者: C ceci3 提交者: GitHub

Fix a bug of quantization (#36982) (#37381)

* fix a quantization bug
Co-authored-by: NXGZhang <46363693+XGZhang11@users.noreply.github.com>
上级 109f8a8e
......@@ -1292,10 +1292,11 @@ class QuantizationFreezePass(object):
var_type=output_var_node.type(),
shape=output_var_node.shape(),
var_dtype=output_var_node.dtype())
x_num_col_dims = 1
if op_node.name() in ['matmul', 'matmul_v2', 'mul']:
x_num_col_dims = len(op_node.outputs[0].shape()) - 1
if op_node.op().has_attr("x_num_col_dims"):
x_num_col_dims = op_node.op().attr("x_num_col_dims")
else:
x_num_col_dims = 1
dequant_op_node = graph.create_op_node(
op_type='fake_channel_wise_dequantize_max_abs',
attrs={
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册