code: def test_fpg():
      # end_level=-1 is equal to end_level=3
      norm_cfg = dict(type="BN", requires_grad=True)
      FPG(
          in_channels=[8, 16, 32, 64],
          out_channels=8,
          inter_channels=8,
          num_outs=5,
          add_extra_convs=True,
          start_level=1,
          end_level=-1,
          stack_times=9,
          paths=["bu"] * 9,
          same_down_trans=None,
          same_up_trans=dict(
              type="conv",
              kernel_size=3,
              stride=2,
              padding=1,
              norm_cfg=norm_cfg,
              inplace=False,
              order=("act", "conv", "norm"),
          ),
          across_lateral_trans=dict(
              type="conv",
              kernel_size=1,
              norm_cfg=norm_cfg,
              inplace=False,
              order=("act", "conv", "norm"),
          ),
          across_down_trans=dict(
              type="interpolation_conv",
              mode="nearest",
              kernel_size=3,
              norm_cfg=norm_cfg,
              order=("act", "conv", "norm"),
              inplace=False,
          ),
          across_up_trans=None,
          across_skip_trans=dict(
              type="conv",
              kernel_size=1,
              norm_cfg=norm_cfg,
              inplace=False,
              order=("act", "conv", "norm"),
          ),
          output_trans=dict(
              type="last_conv",
              kernel_size=3,
              order=("act", "conv", "norm"),
              inplace=False,
          ),
          norm_cfg=norm_cfg,
          skip_inds=[(0, 1, 2, 3), (0, 1, 2), (0, 1), (0,), ()],
      )
      FPG(
          in_channels=[8, 16, 32, 64],
          out_channels=8,
          inter_channels=8,
          num_outs=5,
          add_extra_convs=True,
          start_level=1,
          end_level=3,
          stack_times=9,
          paths=["bu"] * 9,
          same_down_trans=None,
          same_up_trans=dict(
              type="conv",
              kernel_size=3,
              stride=2,
              padding=1,
              norm_cfg=norm_cfg,
              inplace=False,
              order=("act", "conv", "norm"),
          ),
          across_lateral_trans=dict(
              type="conv",
              kernel_size=1,
              norm_cfg=norm_cfg,
              inplace=False,
              order=("act", "conv", "norm"),
          ),
          across_down_trans=dict(
              type="interpolation_conv",
              mode="nearest",
              kernel_size=3,
              norm_cfg=norm_cfg,
              order=("act", "conv", "norm"),
              inplace=False,
          ),
          across_up_trans=None,
          across_skip_trans=dict(
              type="conv",
              kernel_size=1,
              norm_cfg=norm_cfg,
              inplace=False,
              order=("act", "conv", "norm"),
          ),
          output_trans=dict(
              type="last_conv",
              kernel_size=3,
              order=("act", "conv", "norm"),
              inplace=False,
          ),
          norm_cfg=norm_cfg,
          skip_inds=[(0, 1, 2, 3), (0, 1, 2), (0, 1), (0,), ()],
      )
  
      # `end_level` is larger than len(in_channels) - 1
      with pytest.raises(AssertionError):
          FPG(
              in_channels=[8, 16, 32, 64],
              out_channels=8,
              stack_times=9,
              paths=["bu"] * 9,
              start_level=1,
              end_level=4,
              num_outs=2,
              skip_inds=[(0, 1, 2, 3), (0, 1, 2), (0, 1), (0,), ()],
          )
  
      # `num_outs` is not equal to end_level - start_level + 1
      with pytest.raises(AssertionError):
          FPG(
              in_channels=[8, 16, 32, 64],
              out_channels=8,
              stack_times=9,
              paths=["bu"] * 9,
              start_level=1,
              end_level=2,
              num_outs=3,
              skip_inds=[(0, 1, 2, 3), (0, 1, 2), (0, 1), (0,), ()],
          )
  
file_path: mmdetection/tests/test_models/test_necks/test_necks.py
imports: import pytest
  import torch
  from torch.nn.modules.batchnorm import _BatchNorm
  from mmdet.models.necks import FPG, FPN, FPN_CARAFE, NASFCOS_FPN, NASFPN, SSH, YOLOXPAFPN, ChannelMapper, DilatedEncoder, DyHead, SSDNeck, YOLOV3Neck
label_desc: Use image node_id 8 for calling a global function with example usage: test_fpg() without return types