code: def test_res2net_backbone():
      with pytest.raises(KeyError):
          # Res2Net depth should be in [50, 101, 152]
          Res2Net(depth=18)
  
      # Test Res2Net with scales 4, base_width 26
      model = Res2Net(depth=50, scales=4, base_width=26)
      for m in model.modules():
          if is_block(m):
              assert m.scales == 4
      model.train()
  
      imgs = torch.randn(1, 3, 32, 32)
      feat = model(imgs)
      assert len(feat) == 4
      assert feat[0].shape == torch.Size([1, 256, 8, 8])
      assert feat[1].shape == torch.Size([1, 512, 4, 4])
      assert feat[2].shape == torch.Size([1, 1024, 2, 2])
      assert feat[3].shape == torch.Size([1, 2048, 1, 1])
  
imports: import pytest
  import torch
  from mmdet.models.backbones import Res2Net
  from mmdet.models.backbones.res2net import Bottle2neck
  from .utils import is_block
label_desc: Use image node_id 2 for calling a global function with example usage: test_res2net_backbone() without return types