class_docstr: We use the "DefaultTrainer" which contains pre-defined default logic for
  standard training workflow. They may not work for you, especially if you
  are working on a new research project. In that case you can write your
  own training loop. You can use "tools/plain_train_net.py" as an example.
class_docstr_tok: ["We","use","the","``","DefaultTrainer","''","which","contains","pre-defined","default","logic","for","standard","training","workflow",".","They","may","not","work","for","you",",","especially","if","you","are","working","on","a","new","research","project",".","In","that","case","you","can","write","your","own","training","loop",".","You","can","use","``","tools\/plain_train_net.py","''","as","an","example","."]
code: def test_with_TTA(cls, cfg, model):
      logger = logging.getLogger("detectron2.trainer")
      # In the end of training, run an evaluation with TTA
      # Only support some R-CNN models.
      logger.info("Running inference with test-time augmentation ...")
      model = GeneralizedRCNNWithTTA(cfg, model)
      evaluators = [
          cls.build_evaluator(
              cfg,
              name,
              output_folder=os.path.join(
                  cfg.OUTPUT_DIR, "inference_TTA"
              ),
          )
          for name in cfg.DATASETS.TEST
      ]
      res = cls.test(cfg, model, evaluators)
      res = OrderedDict({k + "_TTA": v for k, v in res.items()})
      return res
  
file_path: detectron2/tools/train_net.py
imports: import logging
  import os
  from collections import OrderedDict
  import detectron2.utils.comm
  from detectron2.checkpoint import DetectionCheckpointer
  from detectron2.config import get_cfg
  from detectron2.data import MetadataCatalog
  from detectron2.engine import DefaultTrainer, default_argument_parser, default_setup, hooks, launch
  from detectron2.evaluation import CityscapesInstanceEvaluator, CityscapesSemSegEvaluator, COCOEvaluator, COCOPanopticEvaluator, DatasetEvaluators, LVISEvaluator, PascalVOCDetectionEvaluator, SemSegEvaluator, verify_results
  from detectron2.modeling import GeneralizedRCNNWithTTA
label_desc: Use image node_id 2 for calling the Trainer obj's underlying member method code with example usage: obj.test_with_TTA(cls, cfg, model) and returns: res