From 0997cf8f65139d28ea21e477338e3788fe8b7a12 Mon Sep 17 00:00:00 2001 From: Qiao Longfei Date: Mon, 25 Mar 2019 16:21:17 +0800 Subject: [PATCH] add more check --- paddle/fluid/operators/distributed/parameter_recv.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/paddle/fluid/operators/distributed/parameter_recv.cc b/paddle/fluid/operators/distributed/parameter_recv.cc index 27908aa468..e9d34b1739 100644 --- a/paddle/fluid/operators/distributed/parameter_recv.cc +++ b/paddle/fluid/operators/distributed/parameter_recv.cc @@ -121,11 +121,15 @@ void ParameterRecv::operator()(const RpcContext &rpc_ctx, PADDLE_THROW("unsupported recieved var type"); } } - PADDLE_ENFORCE_EQ(recv_numel, recv_tensor->numel()); + auto numel = recv_tensor->numel(); + if (recv_numel != numel) { + LOG(FATAL) << "recv_numel: " << recv_numel << " acture numel: " << numel; + } + PADDLE_ENFORCE_EQ(recv_numel, numel); } delete local_scope; - VLOG(3) << "ParameterRecv out" << rpc_ctx.var_name; + VLOG(3) << "ParameterRecv out " << rpc_ctx.var_name; } template struct ParameterRecv; -- GitLab