class_docstr: LocalGradientAggregationHelper aggregates gradient updates locally,
  and communicates the updates across machines only once every
  backward_passes_per_step. Only supports graph mode execution.
class_docstr_tok: ["LocalGradientAggregationHelper","aggregates","gradient","updates","locally",",","and","communicates","the","updates","across","machines","only","once","every","backward_passes_per_step",".","Only","supports","graph","mode","execution","."]
code: def _aggregate_grads(self, grads):
      aggregation_ops_list = []
      grads = get_not_none_from_list(grads)
      assert len(grads) == len(self.locally_aggregated_grads)
  
      # Apply new gradient updates to the local copy.
      for idx, grad in enumerate(grads):
          if self.sparse_as_dense and isinstance(
              grad, tf.IndexedSlices
          ):
              grad = tf.convert_to_tensor(grad)
  
          updated_grad_aggregator = self.locally_aggregated_grads[
              idx
          ].assign_add(grad)
          aggregation_ops_list.append(updated_grad_aggregator)
  
      return aggregation_ops_list
  
file_path: horovod/horovod/tensorflow/gradient_aggregation.py
imports: import os
  import tensorflow
  from packaging import version
  from horovod.tensorflow.mpi_ops import size_op
  from horovod.tensorflow.mpi_ops import global_process_set
label_desc: Use image node_id 6 for calling the LocalGradientAggregationHelper obj's underlying member method code with example usage: obj._aggregate_grads(grads) and returns: aggregation_ops_list