From 5145a9345b31b7ff8e644ebff239a470bc745696 Mon Sep 17 00:00:00 2001 From: Shixiaowei02 Date: Thu, 27 Jun 2019 00:33:53 +0800 Subject: [PATCH] update test --- .../lite/kernels/arm/conv_compute_test.cc | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/paddle/fluid/lite/kernels/arm/conv_compute_test.cc b/paddle/fluid/lite/kernels/arm/conv_compute_test.cc index b6da4bbe850..c50f34a5d09 100644 --- a/paddle/fluid/lite/kernels/arm/conv_compute_test.cc +++ b/paddle/fluid/lite/kernels/arm/conv_compute_test.cc @@ -209,11 +209,11 @@ TEST(conv_arm_int8, int8_int32) { filter_int8.mutable_data(); for (int i = 0; i < input_int8.dims().production(); i++) { - input_int8_data[i] = get_rand(-128, 127); + input_int8_data[i] = i % 10 * (i % 3 - 1); } for (int i = 0; i < filter_int8.dims().production(); i++) { - filter_int8_data[i] = get_rand(-128, 127); + filter_int8_data[i] = i % 10 * (i % 3 - 1); } operators::ConvParam param; @@ -237,10 +237,10 @@ TEST(conv_arm_int8, int8_int32) { int8gemm_int32.create(param, &ctx->As()); int8gemm_int32.run(param); - int32_t* output_int32_data = - output_int32.mutable_data(); - int32_t* output_int32_ref_data = - output_int32_ref.mutable_data(); + int* output_int32_data = + output_int32.mutable_data(); + int* output_int32_ref_data = + output_int32_ref.mutable_data(); for (int i = 0; i < output_int32.dims().production(); i++) { @@ -326,15 +326,15 @@ TEST(conv_arm_int8, int8_fp32) { for (int i = 0; i < input_fp32.dims().production(); i++) { - input_fp32_data[i] = get_rand(-100, 100) / 100.f; + input_fp32_data[i] = i % 10 * (i % 3 - 1); } for (int i = 0; i < filter_fp32.dims().production(); i++) { - filter_fp32_data[i] = get_rand(-100, 100) / 100.f; + filter_fp32_data[i] = i % 10 * (i % 3 - 1); } for (int i = 0; i < bias_fp32.dims().production(); i++) { - bias_fp32_data[i] = get_rand(-100, 100) / 100.f; + bias_fp32_data[i] = i % 10 * (i % 3 - 1); } std::vector in_scale; @@ -367,8 +367,8 @@ TEST(conv_arm_int8, int8_fp32) { param.output = &output_int32_ref; conv_compute_ref(param); - int32_t* output_int32_ref_data = - output_int32_ref.mutable_data(); + int* output_int32_ref_data = + output_int32_ref.mutable_data(); // ============ int8gemm_int32 ============ param.output = &output_int32; @@ -381,8 +381,8 @@ TEST(conv_arm_int8, int8_fp32) { int8gemm_int32.create(param, &ctx_int32->As()); int8gemm_int32.run(param); - int32_t* output_int32_data = - output_int32.mutable_data(); + int* output_int32_data = + output_int32.mutable_data(); for (int i = 0; i < output_int32.dims().production(); i++) { EXPECT_NEAR(output_int32_data[i], -- GitLab