From 2a5f1a38ef83865f3aa386fc7c5d9417fbadc3d4 Mon Sep 17 00:00:00 2001 From: yeyunpeng2020 Date: Wed, 29 Sep 2021 17:01:27 +0800 Subject: [PATCH] Fix non-fp32 quantization problem --- .../lite/tools/converter/quantizer/full_quant_quantizer.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mindspore/lite/tools/converter/quantizer/full_quant_quantizer.cc b/mindspore/lite/tools/converter/quantizer/full_quant_quantizer.cc index b8e0132332f..a20a321c16f 100644 --- a/mindspore/lite/tools/converter/quantizer/full_quant_quantizer.cc +++ b/mindspore/lite/tools/converter/quantizer/full_quant_quantizer.cc @@ -655,8 +655,12 @@ STATUS FullQuantQuantizer::DoParameterNodeQuant(const CNodePtr &cnode, const Anf MS_LOG(ERROR) << "Get data type failed."; return RET_ERROR; } + // support for share weight. + if (type_id == kNumberTypeInt8) { + return RET_CONTINUE; + } if (type_id != kNumberTypeFloat32) { - ret = SetInOutQuantParam(input_node, nullptr, primitive, true, input_index); + ret = SetInOutQuantParam(input_node, nullptr, primitive, true, input_index - 1); if (ret != RET_OK) { MS_LOG(ERROR) << "Set In/Out quant param failed."; return ret;