Skip to content

Commit 38af7bc

Browse files
Superjomnluotao1
authored andcommitted
fix manylinux compile error caused by inference lib (#10994)
* update * remove warning * Update test_paddle_inference_api_impl.cc
1 parent 8c54f1f commit 38af7bc

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

paddle/contrib/inference/paddle_inference_api_impl.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,8 @@ std::unique_ptr<PaddlePredictor> PaddlePredictorImpl::Clone() {
140140
LOG(ERROR) << "fail to call InitShared";
141141
return nullptr;
142142
}
143-
return cls;
143+
// fix manylinux compile error.
144+
return std::move(cls);
144145
}
145146

146147
// TODO(panyx0718): Consider merge with Init()?

paddle/contrib/inference/test_paddle_inference_api_impl.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,11 @@ TEST(paddle_inference_api_impl, word2vec) {
6868

6969
std::vector<PaddleTensor> outputs;
7070
ASSERT_TRUE(predictor->Run(cpu_feeds, &outputs));
71-
ASSERT_EQ(outputs.size(), 1);
71+
ASSERT_EQ(outputs.size(), 1UL);
7272
for (size_t i = 0; i < outputs.size(); ++i) {
7373
size_t len = outputs[i].data.length;
7474
float* data = static_cast<float*>(outputs[i].data.data);
75-
for (int j = 0; j < len / sizeof(float); ++j) {
75+
for (size_t j = 0; j < len / sizeof(float); ++j) {
7676
ASSERT_LT(data[j], 1.0);
7777
ASSERT_GT(data[j], -1.0);
7878
}

0 commit comments

Comments
 (0)