diff --git a/paddle/fluid/inference/tests/api/CMakeLists.txt b/paddle/fluid/inference/tests/api/CMakeLists.txt index 5dbc190a817d77e36e2f96bcdbd3d858e574ac39..ef63e16ff6d60e7c351361e898aa30ed5c0a7dbd 100644 --- a/paddle/fluid/inference/tests/api/CMakeLists.txt +++ b/paddle/fluid/inference/tests/api/CMakeLists.txt @@ -377,6 +377,7 @@ inference_analysis_test(lite_mul_model_test SRCS lite_mul_model_test.cc inference_analysis_test(lite_resnet50_test SRCS lite_resnet50_test.cc EXTRA_DEPS ${INFERENCE_EXTRA_DEPS} ARGS --infer_model=${RESNET50_MODEL_DIR}) + inference_analysis_test(test_analyzer_capi SRCS analyzer_capi_tester.cc EXTRA_DEPS ${INFERENCE_EXTRA_DEPS} paddle_fluid_c ARGS --infer_model=${RESNET50_MODEL_DIR}/model) diff --git a/paddle/fluid/inference/tests/api/lite_resnet50_test.cc b/paddle/fluid/inference/tests/api/lite_resnet50_test.cc index e028c6e6410e79d0b1f918496439d670c802ba90..a3fd4b4f6de2377ab8d1e19d0c7307d81b64015c 100644 --- a/paddle/fluid/inference/tests/api/lite_resnet50_test.cc +++ b/paddle/fluid/inference/tests/api/lite_resnet50_test.cc @@ -63,7 +63,8 @@ TEST(AnalysisPredictor, use_gpu) { EXPECT_EQ(outputs.size(), expected_size); float* data_o = static_cast(outputs[0].data.data()); for (size_t j = 0; j < outputs[0].data.length() / sizeof(float); j += 10) { - EXPECT_NEAR(data_o[j], truth_values[j / 10], 6e-3); + EXPECT_NEAR((data_o[j] - truth_values[j / 10]) / truth_values[j / 10], 0., + 10e-5); } }