From c33664c830dc18d146d83e026ea8b5d7dd2c15c9 Mon Sep 17 00:00:00 2001 From: jiweibo Date: Sun, 27 Sep 2020 07:53:13 +0000 Subject: [PATCH] fix unit test. --- .../inference/tests/api/lite_resnet50_test.cc | 39 ++++++++----------- 1 file changed, 17 insertions(+), 22 deletions(-) diff --git a/paddle/fluid/inference/tests/api/lite_resnet50_test.cc b/paddle/fluid/inference/tests/api/lite_resnet50_test.cc index 9ae073e9e5b..da5f0b0dea0 100644 --- a/paddle/fluid/inference/tests/api/lite_resnet50_test.cc +++ b/paddle/fluid/inference/tests/api/lite_resnet50_test.cc @@ -15,6 +15,7 @@ limitations under the License. */ #include #include #include + #include #include "paddle/fluid/inference/tests/api/tester_helper.h" @@ -49,17 +50,14 @@ TEST(AnalysisPredictor, use_gpu) { ASSERT_TRUE(predictor->Run(inputs, &outputs)); const std::vector truth_values = { - 127.780396f, 738.16656f, 1013.2264f, -438.17206f, 366.4022f, - 927.66187f, 736.2241f, -633.68567f, -329.92737f, -430.15637f, - -633.0639f, -146.54858f, -1324.2804f, -1349.3661f, -242.67671f, - 117.44864f, -801.7251f, -391.51495f, -404.8202f, 454.16132f, - 515.48206f, -133.03114f, 69.293076f, 590.09753f, -1434.6917f, - -1070.8903f, 307.0744f, 400.52573f, -316.12177f, -587.1265f, - -161.05742f, 800.3663f, -96.47157f, 748.708f, 868.17645f, - -447.9403f, 112.73656f, 1127.1992f, 47.43518f, 677.7219f, - 593.1881f, -336.4011f, 551.3634f, 397.82474f, 78.39835f, - -715.4006f, 405.96988f, 404.25684f, 246.01978f, -8.430191f, - 131.36617f, -648.0528f}; + 127.779, 738.165, 1013.22, -438.17, 366.401, 927.659, 736.222, + -633.684, -329.927, -430.155, -633.062, -146.548, -1324.28, -1349.36, + -242.675, 117.448, -801.723, -391.514, -404.818, 454.16, 515.48, + -133.031, 69.293, 590.096, -1434.69, -1070.89, 307.074, 400.525, + -316.12, -587.125, -161.056, 800.363, -96.4708, 748.706, 868.174, + -447.938, 112.737, 1127.2, 47.4355, 677.72, 593.186, -336.4, + 551.362, 397.823, 78.3979, -715.398, 405.969, 404.256, 246.019, + -8.42969, 131.365, -648.051}; const size_t expected_size = 1; EXPECT_EQ(outputs.size(), expected_size); @@ -108,17 +106,14 @@ TEST(Predictor, use_gpu) { output_t->CopyToCpu(out_data.data()); const std::vector truth_values = { - 127.780396f, 738.16656f, 1013.2264f, -438.17206f, 366.4022f, - 927.66187f, 736.2241f, -633.68567f, -329.92737f, -430.15637f, - -633.0639f, -146.54858f, -1324.2804f, -1349.3661f, -242.67671f, - 117.44864f, -801.7251f, -391.51495f, -404.8202f, 454.16132f, - 515.48206f, -133.03114f, 69.293076f, 590.09753f, -1434.6917f, - -1070.8903f, 307.0744f, 400.52573f, -316.12177f, -587.1265f, - -161.05742f, 800.3663f, -96.47157f, 748.708f, 868.17645f, - -447.9403f, 112.73656f, 1127.1992f, 47.43518f, 677.7219f, - 593.1881f, -336.4011f, 551.3634f, 397.82474f, 78.39835f, - -715.4006f, 405.96988f, 404.25684f, 246.01978f, -8.430191f, - 131.36617f, -648.0528f}; + 127.779, 738.165, 1013.22, -438.17, 366.401, 927.659, 736.222, + -633.684, -329.927, -430.155, -633.062, -146.548, -1324.28, -1349.36, + -242.675, 117.448, -801.723, -391.514, -404.818, 454.16, 515.48, + -133.031, 69.293, 590.096, -1434.69, -1070.89, 307.074, 400.525, + -316.12, -587.125, -161.056, 800.363, -96.4708, 748.706, 868.174, + -447.938, 112.737, 1127.2, 47.4355, 677.72, 593.186, -336.4, + 551.362, 397.823, 78.3979, -715.398, 405.969, 404.256, 246.019, + -8.42969, 131.365, -648.051}; float* data_o = out_data.data(); for (size_t j = 0; j < out_num; j += 10) { -- GitLab