Exemple #1
0
 def reduce_sum(f):
   return extensions.psum(f, axis_name="bar")
Exemple #2
0
 def reduce_sum(f):
   return extensions.psum(f)
Exemple #3
0
 def reduce_sum(a):
   a = extensions.psum(a)
   tf.nest.map_structure(
       lambda x: self.assertIsInstance(x, tf_np.ndarray), a)
   return a
Exemple #4
0
    def _train_and_reduce(params, inputs, targets, learning_rate=0.1):
      new_w, new_b = train_step(params, inputs, targets, learning_rate)

      return (extensions.psum(new_w) / n_devices,
              extensions.psum(new_b) / n_devices)