code: def from_config(
      cls, config: Config, model: torch.nn.Module, *args, **kwargs
  ):
      # can't run hogwild on cuda
      if cuda.CUDA_ENABLED or config.num_workers == 1:
          return TaskTrainer(config.real_trainer, model)
      return cls(
          config.real_trainer,
          config.num_workers,
          model,
          *args,
          **kwargs,
      )
  
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 1 for calling the HogwildTrainer obj's underlying member method code with example usage: obj.from_config(cls, config, model) and returns: cls, TaskTrainer