From 7a4f09f11a76f2b71cb328ea4320f7fb8177c88e Mon Sep 17 00:00:00 2001 From: duanyanhui <45005871+YanhuiDua@users.noreply.github.com> Date: Wed, 11 Jan 2023 14:24:22 +0800 Subject: [PATCH] fix save_combine_op (#49695) --- paddle/fluid/operators/save_combine_op.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/paddle/fluid/operators/save_combine_op.h b/paddle/fluid/operators/save_combine_op.h index 10acb286ee..99cf934fe4 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, -- GitLab