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","."]
docstr: Registers a source/variable as worker local. Horovod will not perform any global
  operations on gradients corresponding to these sources and will instead return the local
  gradient.
docstr_tok: ["Registers","a","source\/variable","as","worker","local",".","Horovod","will","not","perform","any","global","operations","on","gradients","corresponding","to","these","sources","and","will","instead","return","the","local","gradient","."]
code: def register_local_var(self, var):
      """Registers a source/variable as worker local. Horovod will not perform any global
      operations on gradients corresponding to these sources and will instead return the local
      gradient."""
      if _IS_TF2:
          self._local_vars.add(var.ref())
      else:
          self._local_vars.add(var)
  
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 2 for calling the LocalGradientAggregationHelper obj's underlying member method code with example usage: obj.register_local_var(var) without return types