code: def _tood_head(anchor_type):
      """Set type of tood head."""
      train_cfg = Config(
          dict(
              initial_epoch=4,
              initial_assigner=dict(type="ATSSAssigner", topk=9),
              assigner=dict(type="TaskAlignedAssigner", topk=13),
              alpha=1,
              beta=6,
              allowed_border=-1,
              pos_weight=-1,
              debug=False,
          )
      )
      test_cfg = Config(
          dict(
              nms_pre=1000,
              min_bbox_size=0,
              score_thr=0.05,
              nms=dict(type="nms", iou_threshold=0.6),
              max_per_img=100,
          )
      )
  
      tood_head = TOODHead(
          num_classes=80,
          in_channels=1,
          stacked_convs=1,
          feat_channels=8,  # the same as `la_down_rate` in TaskDecomposition
          norm_cfg=None,
          anchor_type=anchor_type,
          anchor_generator=dict(
              type="AnchorGenerator",
              ratios=[1.0],
              octave_base_scale=8,
              scales_per_octave=1,
              strides=[8, 16, 32, 64, 128],
          ),
          bbox_coder=dict(
              type="DeltaXYWHBBoxCoder",
              target_means=[0.0, 0.0, 0.0, 0.0],
              target_stds=[0.1, 0.1, 0.2, 0.2],
          ),
          initial_loss_cls=dict(
              type="FocalLoss",
              use_sigmoid=True,
              activated=True,  # use probability instead of logit as input
              gamma=2.0,
              alpha=0.25,
              loss_weight=1.0,
          ),
          loss_cls=dict(
              type="QualityFocalLoss",
              use_sigmoid=True,
              activated=True,  # use probability instead of logit as input
              beta=2.0,
              loss_weight=1.0,
          ),
          loss_bbox=dict(type="GIoULoss", loss_weight=2.0),
          train_cfg=train_cfg,
          test_cfg=test_cfg,
      )
      return tood_head
  
file_path: mmdetection/tests/test_models/test_dense_heads/test_tood_head.py
imports: from unittest import TestCase
  import torch
  from mmengine import Config, MessageHub
  from mmengine.structures import InstanceData
  from mmdet import *
  from mmdet.models.dense_heads import TOODHead
label_desc: Use image node_id 1 for calling a global function with example usage: _tood_head(anchor_type) and returns: tood_head