parameters: (self, reduce_op, per_replica_values)
return_statement: return _ungroup_and_make_mirrored(
          new_device_grads,
          per_replica_values[0],
          reduce_op,
          num_between_graph_workers=self._num_workers)
docstring: All-reduce across all workers in a batch.
docstring_summary: All-reduce across all workers in a batch.
docstring_tokens: All - reduce across all workers in a batch .
function: def _do_batch_all_reduce_dense(self, reduce_op, per_replica_values):
      """All-reduce across all workers in a batch."""
  
      logging.log_first_n(
          logging.INFO, "Collective batch_all_reduce: %d all-reduces, "
          "num_workers = %d" % (len(per_replica_values), self._num_workers), 10)
  
      chunked_gv = self._make_gradient_chunks(per_replica_values,
                                              self._all_reduce_merge_scope)
  
      reduced_gv_list = []
      for chunk in chunked_gv:
        with ops.name_scope("allreduce"):
          for grad_and_vars in chunk:
            # Gradients for the same variable but from different devices.
            scaled_grads = [g for g, _ in grad_and_vars]
            collective_reduced = cross_device_utils.build_collective_reduce(
                scaled_grads, self._num_workers, self._collective_keys, "Add",
                "Id")
            result = []
            for (_, v), g in zip(grad_and_vars, collective_reduced):
              result.append([g, v])
            reduced_gv_list.append(result)
  
      new_device_grads = [list(x) for x in zip(*reduced_gv_list)]
      return _ungroup_and_make_mirrored(
          new_device_grads,
          per_replica_values[0],
          reduce_op,
          num_between_graph_workers=self._num_workers)
function_tokens: def _do_batch_all_reduce_dense ( self , reduce_op , per_replica_values ) : logging . log_first_n ( logging . INFO , "Collective batch_all_reduce: %d all-reduces, " "num_workers = %d" % ( len ( per_replica_values ) , self . _num_workers ) , 10 ) chunked_gv = self . _make_gradient_chunks ( per_replica_values , self . _all_reduce_merge_scope ) reduced_gv_list = [ ] for chunk in chunked_gv : with ops . name_scope ( "allreduce" ) : for grad_and_vars in chunk : # Gradients for the same variable but from different devices. scaled_grads = [ g for g , _ in grad_and_vars ] collective_reduced = cross_device_utils . build_collective_reduce ( scaled_grads , self . _num_workers , self . _collective_keys , "Add" , "Id" ) result = [ ] for ( _ , v ) , g in zip ( grad_and_vars , collective_reduced ) : result . append ( [ g , v ] ) reduced_gv_list . append ( result ) new_device_grads = [ list ( x ) for x in zip ( * reduced_gv_list ) ] return _ungroup_and_make_mirrored ( new_device_grads , per_replica_values [ 0 ] , reduce_op , num_between_graph_workers = self . _num_workers )