提交 8f2d0e41 编写于 作者: Y Yanzhan Yang 提交者: Jiaying Zhao

fix quantification diff calculation error (#1733)

上级 3aa84071
...@@ -336,7 +336,9 @@ void LoadWithDumpForFloat32(const paddle_mobile::framework::VarDesc &var_desc, c ...@@ -336,7 +336,9 @@ void LoadWithDumpForFloat32(const paddle_mobile::framework::VarDesc &var_desc, c
diff += abs(value - value_quantized); diff += abs(value - value_quantized);
fwrite(&value_quantized, sizeof(float), 1, out_file); fwrite(&value_quantized, sizeof(float), 1, out_file);
} }
std::cout << "avg diff caused by quantization for var " << var_desc.Name() << " is: " << diff << std::endl; if (memory_size > 0) {
std::cout << "avg diff caused by quantization for var " << var_desc.Name() << " is: " << (diff / memory_size) << std::endl;
}
} }
void void
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册