class_docstr: Uses `horovod.spark.run` to execute the distributed training `fn`.
class_docstr_tok: ["Uses","`","horovod.spark.run","`","to","execute","the","distributed","training","`","fn","`","."]
code: def run(self, fn, args=(), kwargs={}, env=None):
      full_env = self._env or os.environ.copy()
      if env:
          full_env.update(env)
  
      if "CUDA_VISIBLE_DEVICES" in full_env:
          # In TensorFlow 2.0, we set this before calling `run` in order to prevent TensorFlow
          # from allocating memory on the GPU outside the training process.  Once we submit the
          # function for execution, we want to ensure that TensorFLow has visibility into GPUs on
          # the device so we can use them for training, which is why we need to unset this.
          # See https://github.com/tensorflow/tensorflow/issues/33168
          del full_env["CUDA_VISIBLE_DEVICES"]
  
      return horovod.spark.run(
          fn,
          args=args,
          kwargs=kwargs,
          num_proc=self._num_proc,
          env=full_env,
          **self._kwargs,
      )
  
file_path: horovod/horovod/spark/common/backend.py
imports: import horovod.spark.common._namedtuple_fix
  import os
  import pyspark
  import horovod.spark
label_desc: Use image node_id 2 for calling the SparkBackend obj's underlying member method code with example usage: obj.run(fn, args, kwargs, env) and returns: horovod