class_docstr: Build LR scheduler for trainer.
  
  Args:
      lr_scheduler (:class:`colossalai.nn.lr_scheduler`): The specific LR scheduler
          in range of ``colossalai.nn.lr_scheduler``, more details about ``lr_scheduler`` could be found in
          `lr_scheduler <https://github.com/hpcaitech/ColossalAI/tree/main/colossalai/nn/lr_scheduler>`_.
      by_epoch (bool): If `True`, the LR will be scheduled every epoch. Else, the LR will be scheduled every batch.
      store_lr_in_state (bool, optional): If `True`, store the learning rate in each state, defaults to `True`.
      priority (int, optional): Priority in the printing, hooks with small priority will be printed in front
          defaults to 1. If different hooks share same priority, the order of printing would
          depend on the hooks order in the hook list.
code: def after_train_iter(
      self, trainer, output: Tensor, label: Tensor, loss: Tensor
  ):
      if not self.by_epoch:
          self.lr_scheduler.step()
          trainer.states["metrics"]["train"]["LR"].update(
              self.lr_scheduler.get_last_lr()[0]
          )
  
file_path: ColossalAI/colossalai/legacy/trainer/hooks/_lr_scheduler_hook.py
imports: from torch import Tensor
  from colossalai.legacy.registry import HOOKS
  from ._metric_hook import LearningRateMetric, MetricHook
label_desc: Use image node_id 4 for calling the LRSchedulerHook obj's underlying member method code with example usage: obj.after_train_iter(trainer, output, label, loss) without return types