code: def build_top_module(cfg):
      """Build detection head/top module"""
      top_type = cfg.CONFIG.MODEL.DETECTION_TOP_MODULE.NAME
      if top_type == "conv":
          inp = cfg.CONFIG.MODEL.FPN.OUT_CHANNELS
          oup = cfg.CONFIG.MODEL.DETECTION_TOP_MODULE.DIM
          top_module = nn.Conv2d(
              inp, oup, kernel_size=3, stride=1, padding=1
          )
      else:
          top_module = None
      return top_module
  
imports: import torch
  from torch import nn
  from ...data.structures import Instances
  from ...utils.utils import retry_if_cuda_oom
label_desc: Use image node_id 1 for calling a global function with example usage: build_top_module(cfg) and returns: top_module