code: def test_ssd_neck():
      # level_strides/level_paddings must be same length
      with pytest.raises(AssertionError):
          SSDNeck(
              in_channels=[8, 16],
              out_channels=[8, 16, 32],
              level_strides=[2],
              level_paddings=[2, 1],
          )
  
      # length of out_channels must larger than in_channels
      with pytest.raises(AssertionError):
          SSDNeck(
              in_channels=[8, 16],
              out_channels=[8],
              level_strides=[2],
              level_paddings=[2],
          )
  
      # len(out_channels) - len(in_channels) must equal to len(level_strides)
      with pytest.raises(AssertionError):
          SSDNeck(
              in_channels=[8, 16],
              out_channels=[4, 16, 64],
              level_strides=[2, 2],
              level_paddings=[2, 2],
          )
  
      # in_channels must be same with out_channels[:len(in_channels)]
      with pytest.raises(AssertionError):
          SSDNeck(
              in_channels=[8, 16],
              out_channels=[4, 16, 64],
              level_strides=[2],
              level_paddings=[2],
          )
  
      ssd_neck = SSDNeck(
          in_channels=[4],
          out_channels=[4, 8, 16],
          level_strides=[2, 1],
          level_paddings=[1, 0],
      )
      feats = (torch.rand(1, 4, 16, 16),)
      outs = ssd_neck(feats)
      assert outs[0].shape == (1, 4, 16, 16)
      assert outs[1].shape == (1, 8, 8, 8)
      assert outs[2].shape == (1, 16, 6, 6)
  
      # test SSD-Lite Neck
      ssd_neck = SSDNeck(
          in_channels=[4, 8],
          out_channels=[4, 8, 16],
          level_strides=[1],
          level_paddings=[1],
          l2_norm_scale=None,
          use_depthwise=True,
          norm_cfg=dict(type="BN"),
          act_cfg=dict(type="ReLU6"),
      )
      assert not hasattr(ssd_neck, "l2_norm")
  
      from mmcv.cnn.bricks import DepthwiseSeparableConvModule
  
      assert isinstance(
          ssd_neck.extra_layers[0][-1], DepthwiseSeparableConvModule
      )
  
      feats = (torch.rand(1, 4, 8, 8), torch.rand(1, 8, 8, 8))
      outs = ssd_neck(feats)
      assert outs[0].shape == (1, 4, 8, 8)
      assert outs[1].shape == (1, 8, 8, 8)
      assert outs[2].shape == (1, 16, 8, 8)
  
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 5 for calling a global function with example usage: test_ssd_neck() without return types