def reduce_sum(f): return extensions.psum(f, axis_name="bar")
def reduce_sum(f): return extensions.psum(f)
def reduce_sum(a): a = extensions.psum(a) tf.nest.map_structure( lambda x: self.assertIsInstance(x, tf_np.ndarray), a) return a
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)