code: def fit(
      self,
      train_dataset,
      valid_dataset=None,
      config: TezConfig = None,
      **kwargs,
  ):
      if config is None:
          config = TezConfig()
      self._init_trainer(train_dataset, valid_dataset, config, **kwargs)
      for _ in range(self.config.epochs):
          self.train_state = enums.TrainingState.EPOCH_START
          self.train(self.train_loader)
          if self.valid_loader and self.config.val_strategy == "epoch":
              self.validate(self.valid_loader)
          self._step_scheduler_after_epoch()
          self.train_state = enums.TrainingState.EPOCH_END
          if self._model_state == enums.ModelState.END:
              time.sleep(2)
              break
          self.current_epoch += 1
      self.train_state = enums.TrainingState.TRAIN_END
  
imports: import multiprocessing
  import time
  import warnings
  from dataclasses import dataclass
  from typing import Optional
  import torch
  from accelerate import Accelerator
  from torch.utils.data import DataLoader
  from tez import enums
  from tez.callbacks import CallbackRunner, Progress
  from tez.logger import logger
  from tez.utils import AverageMeter
  from .config import TezConfig
label_desc: Use image node_id 27 for calling the Tez obj's underlying member method code with example usage: obj.fit(train_dataset, valid_dataset, config) without return types