code: def test_resnet_unused_stages(self):
      resnet = ResNet(
          BasicStem(),
          ResNet.make_default_stages(18),
          out_features=["res2"],
      )
      self.assertTrue(hasattr(resnet, "res2"))
      self.assertFalse(hasattr(resnet, "res3"))
      self.assertFalse(hasattr(resnet, "res5"))
  
      resnet = ResNet(
          BasicStem(),
          ResNet.make_default_stages(18),
          out_features=["res2", "res5"],
      )
      self.assertTrue(hasattr(resnet, "res2"))
      self.assertTrue(hasattr(resnet, "res4"))
      self.assertTrue(hasattr(resnet, "res5"))
  
file_path: detectron2/tests/layers/test_blocks.py
imports: import unittest
  import torch
  from torch import nn
  from detectron2.layers import ASPP, DepthwiseSeparableConv2d, FrozenBatchNorm2d
  from detectron2.modeling.backbone.resnet import BasicStem, ResNet
label_desc: Use image node_id 4 for calling the TestBlocks obj's underlying member method code with example usage: obj.test_resnet_unused_stages() without return types