code: def run_epoch(
      self,
      state: TrainingState,
      data_iter: Iterator,
      metric_reporter: MetricReporter,
  ):
      if state.stage == Stage.TRAIN:
          processes = []
          for worker_rank in range(self.num_workers):
              # Initialize the batches with different random states.
              worker_state = copy.copy(state)
              worker_state.rank = worker_rank
              data_iter.batches.init_epoch()
              p = mp.Process(
                  target=super().run_epoch,
                  args=(state, data_iter, metric_reporter),
              )
  
              processes.append(p)
              p.start()
          for p in processes:
              p.join()
      else:
          return super().run_epoch(state, data_iter, metric_reporter)
  
file_path: pytext/pytext/trainers/hogwild_trainer.py
imports: import copy
  import torch
  import torch.multiprocessing
  from pytext.common.constants import Stage
  from pytext.config.pytext_config import ConfigBase
  from pytext.legacy.data import Iterator
  from pytext.metric_reporters import MetricReporter
  from pytext.trainers.trainer import TaskTrainer, Trainer, TrainingState
  from pytext.utils import cuda
label_desc: Use image node_id 3 for calling the HogwildTrainer_Deprecated obj's underlying member method code with example usage: obj.run_epoch(state, data_iter, metric_reporter) and returns: super