-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix mul bugs #7964
fix mul bugs #7964
Conversation
Thanks for your contribution! |
…into fix_mul_bug
…into fix_mul_bug
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -518,7 +518,9 @@ void QuantDequantOpFuser::InsertNewNode(SSAGraph* graph, | |||
op_info.UpdateAllInputs(output_var_name, input_var_name); | |||
op_info.SetAttr<int>("bit_length", bit_length); | |||
#ifndef LITE_WITH_FPGA | |||
op_info.SetAttr("enable_int8", true); | |||
std::string op_type = op_info.Type(); | |||
if (op_type == "matmul") op_info.SetAttr("enable_int8", true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个地方建议在头文件定义一个std::vectorstd::string op_types_ 数组,然后判断当前 OP 是否在这个List 里。这样后续有其他OP 支持,只用在vector 添加op_type 即可
*.h : std::vectorstd::string op_types_{"matmul"};
*.cc
if (op_type != op_types_.end()) {
op_info.SetAttr("enable_int8", true);
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
好的
#ifndef LITE_WITH_FPGA | ||
op_info.SetAttr("enable_int8", true); | ||
std::vector<std::string> input_activation_quant_op = {"matmul"}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个放在头文件,作为私有成员变量使用
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
No description provided.