未验证 提交 9f604928 编写于 作者: C cc 提交者: GitHub

quantize_transpiler_v2 supports quantize fp16 tensor (#34398)

上级 0fb15d9f
......@@ -185,7 +185,10 @@ class QuantizeTranspilerV2(object):
new_in_name = var_rename_map[block_id][in_name]
else:
in_var = block.var(in_name)
if in_var.dtype != core.VarDesc.VarType.FP32:
target_dtype = [
core.VarDesc.VarType.FP32, core.VarDesc.VarType.FP16
]
if in_var.dtype not in target_dtype:
continue
quant_bits = self._weight_bits if in_var.persistable \
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册