From 926f5f43a9b8d2f356a02b82d0b94b3940b26bbf Mon Sep 17 00:00:00 2001 From: velconia Date: Thu, 13 Sep 2018 15:37:27 +0800 Subject: [PATCH] fix redundant args of lambda and remove exception of destructor --- paddle/fluid/operators/distributed/proto_encoder_helper.h | 4 +++- paddle/fluid/operators/listen_and_serv_op.cc | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/paddle/fluid/operators/distributed/proto_encoder_helper.h b/paddle/fluid/operators/distributed/proto_encoder_helper.h index 2fab02e32..45f9e4a65 100644 --- a/paddle/fluid/operators/distributed/proto_encoder_helper.h +++ b/paddle/fluid/operators/distributed/proto_encoder_helper.h @@ -83,7 +83,9 @@ class ProtoEncodeHelper { ~ProtoEncodeHelper() { // Make sure callers didn't do operations that went over max_size promised - PADDLE_ENFORCE_LE(p_, limit_); +#define REPLACE_ENFORCE_GLOG 1 + paddle::platform::throw_on_error(p_ <= limit_); +#undef REPLACE_ENFORCE_GLOG } const char* data() const { return base_; } diff --git a/paddle/fluid/operators/listen_and_serv_op.cc b/paddle/fluid/operators/listen_and_serv_op.cc index 966d78b84..13358e5f9 100644 --- a/paddle/fluid/operators/listen_and_serv_op.cc +++ b/paddle/fluid/operators/listen_and_serv_op.cc @@ -60,7 +60,7 @@ static void ParallelExecuteBlocks( std::vector> fs; for (size_t idx : parallel_blkids) { fs.push_back( - framework::Async([&executor, &prepared, &program, &scope, idx]() { + framework::Async([&executor, &prepared, &scope, idx]() { int run_block = idx; // thread local try { VLOG(3) << "running server block: " << run_block -- GitLab