code: def __init__(
      self,
      ch_in,
      ch_out,
      stride,
      shortcut,
      width,
      scales=4,
      variant="b",
      groups=1,
      lr=1.0,
      norm_type="bn",
      norm_decay=0.0,
      freeze_norm=True,
      dcn_v2=False,
  ):
      super(BottleNeck, self).__init__()
  
      self.shortcut = shortcut
      self.scales = scales
      self.stride = stride
      if not shortcut:
          if variant == "d" and stride == 2:
              self.branch1 = nn.Sequential()
              self.branch1.add_sublayer(
                  "pool",
                  nn.AvgPool2D(
                      kernel_size=2, stride=2, padding=0, ceil_mode=True
                  ),
              )
              self.branch1.add_sublayer(
                  "conv",
                  ConvNormLayer(
                      ch_in=ch_in,
                      ch_out=ch_out,
                      filter_size=1,
                      stride=1,
                      norm_type=norm_type,
                      norm_decay=norm_decay,
                      freeze_norm=freeze_norm,
                      lr=lr,
                  ),
              )
          else:
              self.branch1 = ConvNormLayer(
                  ch_in=ch_in,
                  ch_out=ch_out,
                  filter_size=1,
                  stride=stride,
                  norm_type=norm_type,
                  norm_decay=norm_decay,
                  freeze_norm=freeze_norm,
                  lr=lr,
              )
  
      self.branch2a = ConvNormLayer(
          ch_in=ch_in,
          ch_out=width * scales,
          filter_size=1,
          stride=stride if variant == "a" else 1,
          groups=1,
          act="relu",
          norm_type=norm_type,
          norm_decay=norm_decay,
          freeze_norm=freeze_norm,
          lr=lr,
      )
  
      self.branch2b = nn.LayerList(
          [
              ConvNormLayer(
                  ch_in=width,
                  ch_out=width,
                  filter_size=3,
                  stride=1 if variant == "a" else stride,
                  groups=groups,
                  act="relu",
                  norm_type=norm_type,
                  norm_decay=norm_decay,
                  freeze_norm=freeze_norm,
                  lr=lr,
                  dcn_v2=dcn_v2,
              )
              for _ in range(self.scales - 1)
          ]
      )
  
      self.branch2c = ConvNormLayer(
          ch_in=width * scales,
          ch_out=ch_out,
          filter_size=1,
          stride=1,
          groups=1,
          norm_type=norm_type,
          norm_decay=norm_decay,
          freeze_norm=freeze_norm,
          lr=lr,
      )
  
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 BottleNeck object from inherited base classes: nn with example: obj = BottleNeck(ch_in, ch_out, stride, shortcut, width, scales, variant, groups, lr, norm_type, norm_decay, freeze_norm, dcn_v2)