diff --git a/paddle/fluid/inference/api/api_impl.cc b/paddle/fluid/inference/api/api_impl.cc index 85e250aaaf4a18a261a4bfc5271670f93565a336..e5189e958bdf6afe1f94dc9e2d721e3d2c8b904c 100644 --- a/paddle/fluid/inference/api/api_impl.cc +++ b/paddle/fluid/inference/api/api_impl.cc @@ -161,13 +161,14 @@ bool NativePaddlePredictor::Run(const std::vector &inputs, } std::unique_ptr NativePaddlePredictor::Clone() { - VLOG(3) << "Predictor::clone"; std::unique_ptr cls(new NativePaddlePredictor(config_)); - - if (!dynamic_cast(cls.get())->Init(scope_)) { + // Hot fix the bug that result diff in multi-thread. + // TODO(Superjomn) re-implement a real clone here. + if (!dynamic_cast(cls.get())->Init(nullptr)) { LOG(ERROR) << "fail to call Init"; return nullptr; } + #ifdef __clang__ // fix clang compile error return cls;