fix manylinux compile error caused by inference lib (#10994)

* update

* remove warning

* Update test_paddle_inference_api_impl.cc
release/0.13.0
Yan Chunwei 7 years ago committed by Tao Luo
parent 8c54f1fb9c
commit 38af7bcaaf

@ -140,7 +140,8 @@ std::unique_ptr<PaddlePredictor> PaddlePredictorImpl::Clone() {
LOG(ERROR) << "fail to call InitShared"; LOG(ERROR) << "fail to call InitShared";
return nullptr; return nullptr;
} }
return cls; // fix manylinux compile error.
return std::move(cls);
} }
// TODO(panyx0718): Consider merge with Init()? // TODO(panyx0718): Consider merge with Init()?

@ -68,11 +68,11 @@ TEST(paddle_inference_api_impl, word2vec) {
std::vector<PaddleTensor> outputs; std::vector<PaddleTensor> outputs;
ASSERT_TRUE(predictor->Run(cpu_feeds, &outputs)); ASSERT_TRUE(predictor->Run(cpu_feeds, &outputs));
ASSERT_EQ(outputs.size(), 1); ASSERT_EQ(outputs.size(), 1UL);
for (size_t i = 0; i < outputs.size(); ++i) { for (size_t i = 0; i < outputs.size(); ++i) {
size_t len = outputs[i].data.length; size_t len = outputs[i].data.length;
float* data = static_cast<float*>(outputs[i].data.data); float* data = static_cast<float*>(outputs[i].data.data);
for (int j = 0; j < len / sizeof(float); ++j) { for (size_t j = 0; j < len / sizeof(float); ++j) {
ASSERT_LT(data[j], 1.0); ASSERT_LT(data[j], 1.0);
ASSERT_GT(data[j], -1.0); ASSERT_GT(data[j], -1.0);
} }

Loading…
Cancel
Save