diff --git a/paddle/fluid/framework/operator.cc b/paddle/fluid/framework/operator.cc index c9d7af6a44ceab..bf2badc5a82cf6 100644 --- a/paddle/fluid/framework/operator.cc +++ b/paddle/fluid/framework/operator.cc @@ -2081,7 +2081,7 @@ void OperatorWithKernel::RunImpl(const Scope& scope, ExecutionContext(*this, exec_scope, *dev_ctx, *runtime_ctx)); } if (fallback_to_cpu) { - [[maybe_unused]] auto released_kernel = phi_kernel_.release(); + phi_kernel_.reset(); } }