code: def __init__(
      self,
      ch_in,
      ch_out,
      count,
      stage_num,
      width,
      scales=4,
      variant="b",
      groups=1,
      lr=1.0,
      norm_type="bn",
      norm_decay=0.0,
      freeze_norm=True,
      dcn_v2=False,
  ):
      super(Blocks, self).__init__()
  
      self.blocks = nn.Sequential()
      for i in range(count):
          self.blocks.add_sublayer(
              str(i),
              BottleNeck(
                  ch_in=ch_in if i == 0 else ch_out,
                  ch_out=ch_out,
                  stride=2 if i == 0 and stage_num != 2 else 1,
                  shortcut=False if i == 0 else True,
                  width=width * (2 ** (stage_num - 2)),
                  scales=scales,
                  variant=variant,
                  groups=groups,
                  lr=lr,
                  norm_type=norm_type,
                  norm_decay=norm_decay,
                  freeze_norm=freeze_norm,
                  dcn_v2=dcn_v2,
              ),
          )
  
imports: from numbers import Integral
  import paddle
  import paddle.nn
  import paddle.nn.functional
  from ppdet.core.workspace import register, serializable
  from ..shape_spec import ShapeSpec
  from .resnet import ConvNormLayer
label_desc: Use image node_id 1 to create a new Blocks object from inherited base classes: nn with example: obj = Blocks(ch_in, ch_out, count, stage_num, width, scales, variant, groups, lr, norm_type, norm_decay, freeze_norm, dcn_v2)