We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 556be6d commit d19e266Copy full SHA for d19e266
paddle/fluid/operators/run_program_op.h
@@ -198,7 +198,11 @@ class RunProgramOpKernel : public framework::OpKernel<T> {
198
199
auto exe_ctx = exe.Prepare(*program, 0, skip_vars);
200
201
+ // get scope and clear old vars
202
framework::Scope &scope = *(out_scope_vec->front());
203
+ auto local_vars = scope.LocalVarNames();
204
+ scope.EraseVars(local_vars);
205
+
206
// share input_vars & parameters into scope
207
details::ShareVarsIntoScope(input_vars, input_var_names, &scope);
208
details::ShareVarsIntoScope(param_vars, param_names, &scope);
0 commit comments