class_docstr: SPOS trainer.
  
  Parameters
  ----------
  n_warmup : int
      Number of epochs for training super network.
  model_lr : float
      Learning rate for super network.
  model_wd : float
      Weight decay for super network.
  
  Other parameters see Evolution
class_docstr_tok: ["SPOS","trainer",".","Parameters","--","--","--","--","--","n_warmup",":","int","Number","of","epochs","for","training","super","network",".","model_lr",":","float","Learning","rate","for","super","network",".","model_wd",":","float","Weight","decay","for","super","network",".","Other","parameters","see","Evolution"]
code: def _train_one_epoch(self, epoch):
      self.model.train()
      self.model_optim.zero_grad()
      self._resample()  # uniform sampling
      metric, loss = self._infer(mask="train")
      loss.backward()
      if self.grad_clip > 0:
          nn.utils.clip_grad_norm_(
              self.model.parameters(), self.grad_clip
          )
      self.model_optim.step()
      return metric, loss.item()
  
imports: import copy
  from logging import Logger
  from numpy.core.fromnumeric import sort
  import torch
  import torch.nn
  import torch.nn.functional
  from .None import register_nas_algo
  from .base import BaseNAS
  from ..space import BaseSpace
  from ..utils import AverageMeterGroup, replace_layer_choice, replace_input_choice, get_module_order, sort_replaced_module, PathSamplingLayerChoice, PathSamplingInputChoice
  from tqdm import tqdm, trange
  from ....utils import get_logger
  import numpy
  import collections
  import dataclasses
  import random
label_desc: Use image node_id 6 for calling the Spos obj's underlying member method code with example usage: obj._train_one_epoch(epoch) and returns: metric,  loss