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

fix save channel wise quant model (#39054)

上级 064bc4b8
...@@ -1220,6 +1220,8 @@ class QuantizationFreezePass(object): ...@@ -1220,6 +1220,8 @@ class QuantizationFreezePass(object):
if op_node_desc.has_attr("quantization_type") and \ if op_node_desc.has_attr("quantization_type") and \
op_node_desc.attr("quantization_type") == "qat_with_weight": op_node_desc.attr("quantization_type") == "qat_with_weight":
if self._weight_quantize_type == 'channel_wise_abs_max': if self._weight_quantize_type == 'channel_wise_abs_max':
quant_axis = 1 if op_node.name() in \
_channelwise_quant_axis1_ops else 0
self._insert_post_channel_dequant_op(graph, op_node, self._insert_post_channel_dequant_op(graph, op_node,
quant_axis) quant_axis)
else: else:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册