Skip to content

Commit ae27422

Browse files
author
Thomas Mulc
committed
new standard is 6 spaces for new line continuation
1 parent 323f246 commit ae27422

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

ADAG/ADAG.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,32 +27,32 @@ def main():
2727

2828
if FLAGS.job_name == 'ps': #checks if parameter server
2929
server = tf.train.Server(cluster,
30-
job_name="ps",
31-
task_index=FLAGS.task_index,
32-
config=config)
30+
job_name="ps",
31+
task_index=FLAGS.task_index,
32+
config=config)
3333
server.join()
3434
else: #it must be a worker server
3535
is_chief = (FLAGS.task_index == 0) #checks if this is the chief node
3636
server = tf.train.Server(cluster,
37-
job_name="worker",
38-
task_index=FLAGS.task_index,
39-
config=config)
37+
job_name="worker",
38+
task_index=FLAGS.task_index,
39+
config=config)
4040

4141
# Graph
4242
# We must not use train.replicate_device_setter for normal operations
4343
# Local operations
4444
with tf.device("/job:worker/replica:0/task:%d" % FLAGS.task_index):
4545
a = tf.Variable(tf.constant(0.,shape=[2]),dtype=tf.float32,
46-
collections=[tf.GraphKeys.LOCAL_VARIABLES])
46+
collections=[tf.GraphKeys.LOCAL_VARIABLES])
4747
b = tf.Variable(tf.constant(0.,shape=[2]),dtype=tf.float32,
48-
collections=[tf.GraphKeys.LOCAL_VARIABLES])
48+
collections=[tf.GraphKeys.LOCAL_VARIABLES])
4949
c=a+b
5050
local_step = tf.Variable(0,dtype=tf.int32,trainable=False,
51-
name='local_step',collections=['local_non_trainable'])
51+
name='local_step',collections=['local_non_trainable'])
5252

5353
with tf.device(tf.train.replica_device_setter(
54-
ps_tasks=n_pss, \
55-
worker_device="/job:%s/task:%d" % (FLAGS.job_name,FLAGS.task_index))):
54+
ps_tasks=n_pss,
55+
worker_device="/job:%s/task:%d" % (FLAGS.job_name,FLAGS.task_index))):
5656
global_step = tf.Variable(0,dtype=tf.int32,trainable=False,name='global_step')
5757
target = tf.constant(100.,shape=[2],dtype=tf.float32)
5858
loss = tf.reduce_mean(tf.square(c-target))
@@ -79,7 +79,7 @@ def main():
7979
var_list=tf.local_variables()))
8080
grad_list.append(grads) #add gradients to the list
8181
opt_local = loptimizer.apply_gradients(zip(grads,varss),
82-
global_step=local_step) #update local parameters
82+
global_step=local_step) #update local parameters
8383
grads = tf.reduce_mean(grad_list,axis=0)
8484
grads = tuple([grads[i]for i in range(len(varss))])
8585
opt = optimizer.apply_gradients(

0 commit comments

Comments
 (0)