未验证 提交 81e702ac 编写于 作者: X XGZhang 提交者: GitHub

quant: fix a export bug (#35410)

上级 2d6871d3
......@@ -568,10 +568,11 @@ class ImperativeQuantizeOutputs(object):
out_scale = utils.fp_numpy_to_naive(out_scale)
if previous_op.type != "feed":
argname, index = utils._get_output_name_index(previous_op,
in_var_name)
previous_op._set_attr(argname + str(index) + "_threshold",
out_scale)
res = utils._get_output_name_index(previous_op, in_var_name)
if res is not None:
argname, index = res
previous_op._set_attr(
argname + str(index) + "_threshold", out_scale)
previous_op._set_attr("out_threshold", out_scale)
for next_op in next_ops:
......
......@@ -134,6 +134,7 @@ _op_real_in_out_name = {
"flatten": [["X"], ["Out"]],
"flatten2": [["X"], ["Out"]],
"unsqueeze2": [["X"], ["Out"]],
"flatten_contiguous_range": [['X'], ["Out", "XShape"]],
}
_conv_ops = ['conv2d', 'depthwise_conv2d', 'conv2d_transpose']
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册