!24415 Fix non-fp32 quantization problem

Merge pull request !24415 from yeyunpeng2020/master
This commit is contained in:
i-robot 2021-09-30 03:09:48 +00:00 committed by Gitee
commit 56ef451d43
1 changed files with 5 additions and 1 deletions

View File

@ -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;