diff --git a/paddle/fluid/operators/distributed/communicator.cc b/paddle/fluid/operators/distributed/communicator.cc index 91e2417d0ccf164fde89fb8a1e3c7b3f44dcfa73..f17af56400ea8751a12c23b5289cb3be20dcc4bb 100644 --- a/paddle/fluid/operators/distributed/communicator.cc +++ b/paddle/fluid/operators/distributed/communicator.cc @@ -66,8 +66,6 @@ static inline void MergeVars(const std::string &var_name, // init output tensor auto *out_t = out_var->GetMutable(); - auto *out_ptr = out_t->mutable_data( - var0->Get().dims(), cpu_place); auto numel = out_t->numel(); // check the input dims @@ -83,7 +81,7 @@ static inline void MergeVars(const std::string &var_name, constant_functor(cpu_ctx, out_t, static_cast(0)); // sum all vars to out - auto result = EigenVector::Flatten(*out_t); + auto result = EigenVector::Flatten(*out_t); for (auto &var : vars) { auto &in_t = var->Get(); auto in = EigenVector::Flatten(in_t);