Guest User

Untitled

a guest
Dec 19th, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. # ...
  2. if FLAGS.job_name == 'ps':
  3. with tf.device('/job:ps/task:0'):
  4. counter = tf.Variable(0, name='counter', trainable=False)
  5. with tf.Session(server.target):
  6. sess.run(tf.global_variables_initializer())
  7.  
  8. elif FLAGS.job_name == 'worker':
  9.  
  10. with tf.device('/job:ps/task:0'):
  11. counter = tf.Variable(0, name='counter', trainable=False)
  12.  
  13. with tf.Session(server.target):
  14. sess.run(counter.assign_add(1))
Add Comment
Please, Sign In to add comment