From 3666d7c02f6c9aa51a7a6b81dce8d8590b1a4f90 Mon Sep 17 00:00:00 2001 From: typhoonzero Date: Tue, 20 Mar 2018 16:14:22 +0800 Subject: [PATCH] fix num_blocks==2 --- paddle/fluid/operators/listen_and_serv_op.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/paddle/fluid/operators/listen_and_serv_op.cc b/paddle/fluid/operators/listen_and_serv_op.cc index 2abb5fc101..a594de67e0 100644 --- a/paddle/fluid/operators/listen_and_serv_op.cc +++ b/paddle/fluid/operators/listen_and_serv_op.cc @@ -157,8 +157,8 @@ class ListenAndServOp : public framework::OperatorBase { })); } for (int i = 0; i < num_blocks - 2; ++i) fs[i].wait(); - // Run global block at final step - if (num_blocks > 2) { + // Run global block at final step, or block1 if there are only 2 blocks + if (num_blocks >= 2) { try { executor.Run(*program, &recv_scope, num_blocks - 1, false /*create_local_scope*/, false /*create_vars*/); -- GitLab