提交 654b13b2 编写于 作者: H hjchen2

Fix round tyep in quantize unittest

上级 65ea1249
...@@ -132,7 +132,7 @@ int TestQuqntizeOp(const int batch_size, const int channel, const int height, ...@@ -132,7 +132,7 @@ int TestQuqntizeOp(const int batch_size, const int channel, const int height,
framework::Tensor output_cmp; framework::Tensor output_cmp;
output_cmp.Resize(output->dims()); output_cmp.Resize(output->dims());
float scale = 127 / output_scale_cmp; float scale = 127 / output_scale_cmp;
quantize<round::RoundAwayZero>(input, scale, &output_cmp); quantize<round::RoundTowardsZero>(input, scale, &output_cmp);
int8_t *output_cmp_data = output_cmp.data<int8_t>(); int8_t *output_cmp_data = output_cmp.data<int8_t>();
for (int i = 0; i < output->numel(); ++i) { for (int i = 0; i < output->numel(); ++i) {
PADDLE_MOBILE_ENFORCE(output_data[i] == output_cmp_data[i], PADDLE_MOBILE_ENFORCE(output_data[i] == output_cmp_data[i],
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册