diff --git a/paddle/fluid/operators/save_combine_op.h b/paddle/fluid/operators/save_combine_op.h index 10acb286ee49ded8f971cb49e2231bd1b9a08822..99cf934fe4a28576f6229524b4cce7e85e873213 100644 --- a/paddle/fluid/operators/save_combine_op.h +++ b/paddle/fluid/operators/save_combine_op.h @@ -211,8 +211,8 @@ class SaveCombineOpKernel : public framework::OpKernel { if (inp_vars.size() > 0 && inp_vars[0]->IsType()) { std::vector x(inp_vars.size()); - for (auto inp_var : inp_vars) { - x.push_back(&(inp_var->Get())); + for (size_t i = 0; i < inp_vars.size(); i++) { + x[i] = (&(inp_vars[i]->Get())); } SaveCombineTensorKernel(dev_ctx, x, @@ -223,8 +223,8 @@ class SaveCombineOpKernel : public framework::OpKernel { output); } else { std::vector x(inp_vars.size()); - for (auto inp_var : inp_vars) { - x.push_back(&(inp_var->Get())); + for (size_t i = 0; i < inp_vars.size(); i++) { + x[i] = (&(inp_vars[i]->Get())); } SaveCombineVocabKernel(dev_ctx, x,