class_docstr: LR Scheduler in MMCV.
  
  Args:
      by_epoch (bool): LR changes epoch by epoch
      warmup (string): Type of warmup used. It can be None(use no warmup),
          'constant', 'linear' or 'exp'
      warmup_iters (int): The number of iterations or epochs that warmup
          lasts
      warmup_ratio (float): LR used at the beginning of warmup equals to
          warmup_ratio * initial_lr
      warmup_by_epoch (bool): When warmup_by_epoch == True, warmup_iters
          means the number of epochs that warmup lasts, otherwise means the
          number of iteration that warmup lasts
code: def before_train_iter(self, runner):
      cur_iter = runner.iter
      if not self.by_epoch:
          self.regular_lr = self.get_regular_lr(runner)
          if self.warmup is None or cur_iter >= self.warmup_iters:
              self._set_lr(runner, self.regular_lr)
          else:
              warmup_lr = self.get_warmup_lr(cur_iter)
              self._set_lr(runner, warmup_lr)
      elif self.by_epoch:
          if self.warmup is None or cur_iter > self.warmup_iters:
              return
          elif cur_iter == self.warmup_iters:
              self._set_lr(runner, self.regular_lr)
          else:
              warmup_lr = self.get_warmup_lr(cur_iter)
              self._set_lr(runner, warmup_lr)
  
imports: import numbers
  from math import cos, pi
  import annotator.uniformer.mmcv
  from .hook import HOOKS, Hook
label_desc: Use image node_id 8 for calling the LrUpdaterHook obj's underlying member method code with example usage: obj.before_train_iter(runner) without return types