Skip to content

Commit 75c9eb1

Browse files
committed
refine
1 parent bdb47cd commit 75c9eb1

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

python/paddle/fluid/distribute_transpiler.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -283,14 +283,6 @@ def get_pserver_program(self, endpoint):
283283
orig_var_name = v.name[:suff_idx]
284284
else:
285285
orig_var_name = v.name
286-
#TODO(panyx0718): Should this be put in the else block below? It's
287-
# only used there and it's called single_trainer_var.
288-
single_trainer_var = pserver_program.global_block().create_var(
289-
name=orig_var_name,
290-
persistable=True,
291-
type=v.type,
292-
dtype=v.dtype,
293-
shape=v.shape)
294286
if self.trainers > 1:
295287
for trainer_id in xrange(self.trainers):
296288
var = pserver_program.global_block().create_var(
@@ -301,6 +293,12 @@ def get_pserver_program(self, endpoint):
301293
shape=v.shape)
302294
recv_inputs.append(var)
303295
else:
296+
single_trainer_var = pserver_program.global_block().create_var(
297+
name=orig_var_name,
298+
persistable=True,
299+
type=v.type,
300+
dtype=v.dtype,
301+
shape=v.shape)
304302
recv_inputs.append(single_trainer_var)
305303

306304
# step3
@@ -825,8 +823,6 @@ def _get_lr_ops(self):
825823
# make a union find struct by the ops in default_main_program
826824
ufind = UnionFind(block.ops)
827825

828-
# TODO(panyx0718): If lr_ops connects with other training
829-
# ops, could they be considered as lr_ops?
830826
for op1 in block.ops:
831827
for op2 in block.ops:
832828
# NOTE: we need to skip all optimize ops, since it is connected

0 commit comments

Comments
 (0)