Skip to content

Commit d4691ce

Browse files
committed
fix mac build
1 parent cfc02d2 commit d4691ce

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

paddle/fluid/inference/api/api_impl.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ bool NativePaddlePredictor::Init(
6666
if (parent_scope) {
6767
scope_ = parent_scope;
6868
sub_scope_ = &(parent_scope->NewScope());
69+
PADDLE_ENFORCE_NOT_NULL(sub_scope_, "create sub scope fail");
6970
} else {
7071
paddle::framework::InitDevices(false);
7172
scope_.reset(new paddle::framework::Scope());
@@ -102,7 +103,6 @@ bool NativePaddlePredictor::Init(
102103

103104
NativePaddlePredictor::~NativePaddlePredictor() {
104105
if (sub_scope_) {
105-
PADDLE_ENFORCE_NOT_NULL(scope_, "Should have parent scope!");
106106
scope_->DeleteScope(sub_scope_);
107107
}
108108
}

0 commit comments

Comments
 (0)