未验证 提交 70ce6dcd 编写于 作者: Y Yan Chunwei 提交者: GitHub

fix api_impl ci error (#14140)

上级 eb37ed4c
...@@ -22,9 +22,9 @@ limitations under the License. */ ...@@ -22,9 +22,9 @@ limitations under the License. */
#include "paddle/fluid/inference/tests/test_helper.h" #include "paddle/fluid/inference/tests/test_helper.h"
#ifdef __clang__ #ifdef __clang__
#define ACC_DIFF 4e-3 #define ACC_DIFF 4e-2
#else #else
#define ACC_DIFF 1e-3 #define ACC_DIFF 1e-2
#endif #endif
DEFINE_string(dirname, "", "Directory of the inference model."); DEFINE_string(dirname, "", "Directory of the inference model.");
...@@ -187,7 +187,7 @@ void MainThreadsWord2Vec(bool use_gpu) { ...@@ -187,7 +187,7 @@ void MainThreadsWord2Vec(bool use_gpu) {
std::vector<std::thread> threads; std::vector<std::thread> threads;
for (int tid = 0; tid < num_jobs; ++tid) { for (int tid = 0; tid < num_jobs; ++tid) {
threads.emplace_back([&, tid]() { threads.emplace_back([&, tid]() {
auto predictor = main_predictor->Clone(); auto predictor = CreatePaddlePredictor(config);
auto& local_inputs = paddle_tensor_feeds[tid]; auto& local_inputs = paddle_tensor_feeds[tid];
std::vector<PaddleTensor> local_outputs; std::vector<PaddleTensor> local_outputs;
ASSERT_TRUE(predictor->Run(local_inputs, &local_outputs)); ASSERT_TRUE(predictor->Run(local_inputs, &local_outputs));
...@@ -245,7 +245,7 @@ void MainThreadsImageClassification(bool use_gpu) { ...@@ -245,7 +245,7 @@ void MainThreadsImageClassification(bool use_gpu) {
std::vector<std::thread> threads; std::vector<std::thread> threads;
for (int tid = 0; tid < num_jobs; ++tid) { for (int tid = 0; tid < num_jobs; ++tid) {
threads.emplace_back([&, tid]() { threads.emplace_back([&, tid]() {
auto predictor = main_predictor->Clone(); auto predictor = CreatePaddlePredictor(config);
auto& local_inputs = paddle_tensor_feeds[tid]; auto& local_inputs = paddle_tensor_feeds[tid];
std::vector<PaddleTensor> local_outputs; std::vector<PaddleTensor> local_outputs;
ASSERT_TRUE(predictor->Run(local_inputs, &local_outputs)); ASSERT_TRUE(predictor->Run(local_inputs, &local_outputs));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册