From d4691cedec2151b701b31ec945a306a7de56aeb3 Mon Sep 17 00:00:00 2001 From: tensor-tang Date: Wed, 18 Jul 2018 18:14:56 +0800 Subject: [PATCH] fix mac build --- paddle/fluid/inference/api/api_impl.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paddle/fluid/inference/api/api_impl.cc b/paddle/fluid/inference/api/api_impl.cc index 9d9e126e134..786dc8e8278 100644 --- a/paddle/fluid/inference/api/api_impl.cc +++ b/paddle/fluid/inference/api/api_impl.cc @@ -66,6 +66,7 @@ bool NativePaddlePredictor::Init( if (parent_scope) { scope_ = parent_scope; sub_scope_ = &(parent_scope->NewScope()); + PADDLE_ENFORCE_NOT_NULL(sub_scope_, "create sub scope fail"); } else { paddle::framework::InitDevices(false); scope_.reset(new paddle::framework::Scope()); @@ -102,7 +103,6 @@ bool NativePaddlePredictor::Init( NativePaddlePredictor::~NativePaddlePredictor() { if (sub_scope_) { - PADDLE_ENFORCE_NOT_NULL(scope_, "Should have parent scope!"); scope_->DeleteScope(sub_scope_); } } -- GitLab