code: def _init_model(
      self,
      device,
      train_dataset,
      valid_dataset,
      train_sampler,
      valid_sampler,
      train_bs,
      valid_bs,
      n_jobs,
      callbacks,
      fp16,
      train_collate_fn,
      valid_collate_fn,
      train_shuffle,
      valid_shuffle,
      accumulation_steps,
      clip_grad_norm,
  ):
      if callbacks is None:
          callbacks = list()
  
      if n_jobs == -1:
          n_jobs = psutil.cpu_count()
  
      self.device = device
      self.accumulation_steps = accumulation_steps
      self.clip_grad_norm = clip_grad_norm
  
      if next(self.parameters()).device != self.device:
          self.to(self.device)
  
      if self.train_loader is None:
          self.train_loader = torch.utils.data.DataLoader(
              train_dataset,
              batch_size=train_bs,
              num_workers=n_jobs,
              sampler=train_sampler,
              shuffle=train_shuffle,
              collate_fn=train_collate_fn,
          )
      if self.valid_loader is None:
          if valid_dataset is not None:
              self.valid_loader = torch.utils.data.DataLoader(
                  valid_dataset,
                  batch_size=valid_bs,
                  num_workers=n_jobs,
                  sampler=valid_sampler,
                  shuffle=valid_shuffle,
                  collate_fn=valid_collate_fn,
              )
  
      if self.optimizer is None:
          self.optimizer = self.fetch_optimizer()
  
      if self.scheduler is None:
          self.scheduler = self.fetch_scheduler()
  
      self.fp16 = fp16
      if self.fp16:
          self.scaler = torch.cuda.amp.GradScaler()
  
      self._callback_runner = CallbackRunner(callbacks, self)
      self.train_state = enums.TrainingState.TRAIN_START
  
imports: import warnings
  import psutil
  import torch
  import torch.nn
  from tqdm import tqdm
  from tez import enums
  from tez.callbacks import CallbackRunner
  from tez.utils import AverageMeter
label_desc: Use image node_id 7 for calling the Model obj's underlying member method code with example usage: obj._init_model(device, train_dataset, valid_dataset, train_sampler, valid_sampler, train_bs, valid_bs, n_jobs, callbacks, fp16, train_collate_fn, valid_collate_fn, train_shuffle, valid_shuffle, accumulation_steps, clip_grad_norm) without return types