class_docstr: This is a class tending for easy deployments of users' training and evaluation instead of
  writing their own scripts. It is similar with ``ignite.engine`` and ``keras.engine``, but is
  called `Trainer`.
  
  Args:
      engine (:class:`Engine`): Engine responsible for the process function.
      timer (:class:`MultiTimer`, optional): Timer used to monitor the whole training.
      logger (:class:`colossalai.logging.DistributedLogger`, optional): Logger used to record the whole training log.
  
  
  Examples:
      >>> # define model, criterion, optimizer, lr_scheduler, train_dataloader for your training
      >>> model = ...
      >>> criterion = ...
      >>> optimizer = ...
      >>> train_dataloader = ...
      >>> # Initialize your engine, train_dataloader, test_dataloader, lr_scheduler
      >>> engine, train_dataloader, _, _ = colossalai.initialize(model, optimizer, criterion)
      >>> # Beginning training progress
      >>> timer = ...
      >>> logger = ...
      >>> trainer = Trainer(engine=engine, logger=logger, timer=timer)
      >>> # add hooks you would like to use here.
      >>> hook_list = []
      >>> trainer.fit(
      >>>    train_dataloader=train_dataloader,
      >>>    epochs=gpc.config.NUM_EPOCHS,
      >>>    test_interval=1,
      >>>    hooks=hook_list,
      >>>    display_progress=True,
      >>>    return_output_label=False
      >>>    )
  
  More examples and details could be found in
  `Training with engine and trainer <https://www.colossalai.org/docs/basics/engine_trainer>`_
  and `ColossalAI-Examples <https://github.com/hpcaitech/ColossalAI-Examples/tree/main>`_.
code: def engine(self):
      return self._engine
  
imports: from typing import Any, List, Union
  import torch
  from torch.utils.data import DataLoader
  from tqdm import tqdm
  from colossalai.legacy.engine import Engine
  from colossalai.legacy.trainer.hooks import BaseHook
  from colossalai.legacy.utils import is_dp_rank_0, is_no_pp_or_last_stage, is_tp_rank_0
  from colossalai.logging import DistributedLogger
  from colossalai.utils import MultiTimer
label_desc: Use image node_id 8 for calling the Trainer obj's underlying member method code with example usage: obj.engine() and returns: self