class_docstr: Manages a PyTorch model for training.
class_docstr_tok: ["Manages","a","PyTorch","model","for","training","."]
code: def __init__(
      self,
      model_creator,
      optimizer_creator,
      loss_creator=None,
      metrics=None,
      scheduler_creator=None,
      training_operator_cls=None,
      config=None,
      use_tqdm=False,
      scheduler_step_freq=None,
  ):
      self.model_creator = model_creator
      self.optimizer_creator = optimizer_creator
      self.loss_creator = loss_creator
      self.scheduler_creator = scheduler_creator
      self.training_operator_cls = (
          training_operator_cls or TrainingOperator
      )
      self.config = {} if config is None else config
  
      self.timers = utils.TimerCollection()
      self.epochs = 0
      self.models = None
      self.optimizers = None
      self.metrics = metrics
      self.criterion = None
      self.schedulers = None
      self.train_loader = None
      self.validation_loader = None
      self.training_operator = None
      self.use_tqdm = use_tqdm
      self.scheduler_step_freq = scheduler_step_freq
  
      self.backend = "torch-local"
      self.rank = 0
      self.size = 0
  
imports: from filelock import FileLock
  import logging
  import io
  import itertools
  import os
  import tempfile
  import torch
  import torch.nn
  from torch.utils.data import DataLoader
  from torch.utils.data.distributed import DistributedSampler
  import ray
  from zoo.orca import OrcaContext
  from zoo.orca.learn.pytorch.constants import SCHEDULER_STEP, NUM_STEPS
  from zoo.orca.learn.pytorch.training_operator import TrainingOperator
  from zoo.orca.learn.pytorch import utils
  from zoo.orca.learn.pytorch.utils import find_free_port
label_desc: Use image node_id 1 to create a new TorchRunner object  with example: obj = TorchRunner(model_creator, optimizer_creator, loss_creator, metrics, scheduler_creator, training_operator_cls, config, use_tqdm, scheduler_step_freq)