class_docstr: Distributed trainer for using multiple training processes
code: def train(self, task):
      _init_env_vars(task.use_gpu)
      _init_distributed(task.use_gpu)
      logging.info(
          f"Done setting up distributed process_group with rank {get_rank()}"
          + f", world_size {get_world_size()}"
      )
      local_rank = int(os.environ["LOCAL_RANK"])
      if task.use_gpu:
          logging.info(
              "Using GPU, CUDA device index: {}".format(local_rank)
          )
          set_cuda_device_index(local_rank)
      else:
          logging.info("Using CPU")
          set_cpu_device()
  
      super().train(task)
  
file_path: ClassyVision/classy_vision/trainer/distributed_trainer.py
imports: import logging
  import os
  import torch
  from classy_vision.generic.distributed_util import get_rank, get_world_size, set_cpu_device, set_cuda_device_index
  from .classy_trainer import ClassyTrainer
label_desc: Use image node_id 1 for calling the DistributedTrainer obj's underlying member method code with example usage: obj.train(task) without return types