diff --git a/paddle/contrib/inference/paddle_inference_api_impl.cc b/paddle/contrib/inference/paddle_inference_api_impl.cc index bf510620eb139f7fe701a3d52e70f86ddb3b8ede..349bd3b40368956dd9656ce7f062525f2612e5c1 100644 --- a/paddle/contrib/inference/paddle_inference_api_impl.cc +++ b/paddle/contrib/inference/paddle_inference_api_impl.cc @@ -135,11 +135,10 @@ bool PaddlePredictorImpl::Run(const std::vector &inputs, std::unique_ptr PaddlePredictorImpl::Clone() { VLOG(3) << "Predictor::clone"; - std::unique_ptr cls(nullptr); + std::unique_ptr cls(new PaddlePredictorImpl(config_)); if (!cls->InitShared()) { LOG(ERROR) << "fail to call InitShared"; - } else { - cls.reset(new PaddlePredictorImpl(config_)); + return nullptr; } // fix manylinux compile error. return cls;