code: def __init__(
      self,
      in_planes: int,
      out_planes: int,
      block_num: int = 3,
      stride: int = 1,
  ):
      super(AddBottleneck, self).__init__()
      assert block_num > 1, "block number should be larger than 1."
      self.conv_list = nn.LayerList()
      self.stride = stride
      if stride == 2:
          self.avd_layer = nn.Sequential(
              nn.Conv2D(
                  out_planes // 2,
                  out_planes // 2,
                  kernel_size=3,
                  stride=2,
                  padding=1,
                  groups=out_planes // 2,
                  bias_attr=False,
              ),
              nn.BatchNorm2D(out_planes // 2),
          )
          self.skip = nn.Sequential(
              nn.Conv2D(
                  in_planes,
                  in_planes,
                  kernel_size=3,
                  stride=2,
                  padding=1,
                  groups=in_planes,
                  bias_attr=False,
              ),
              nn.BatchNorm2D(in_planes),
              nn.Conv2D(
                  in_planes, out_planes, kernel_size=1, bias_attr=False
              ),
              nn.BatchNorm2D(out_planes),
          )
          stride = 1
  
      for idx in range(block_num):
          if idx == 0:
              self.conv_list.append(
                  ConvBNRelu(in_planes, out_planes // 2, kernel=1)
              )
          elif idx == 1 and block_num == 2:
              self.conv_list.append(
                  ConvBNRelu(
                      out_planes // 2, out_planes // 2, stride=stride
                  )
              )
          elif idx == 1 and block_num > 2:
              self.conv_list.append(
                  ConvBNRelu(
                      out_planes // 2, out_planes // 4, stride=stride
                  )
              )
          elif idx < block_num - 1:
              self.conv_list.append(
                  ConvBNRelu(
                      out_planes // int(math.pow(2, idx)),
                      out_planes // int(math.pow(2, idx + 1)),
                  )
              )
          else:
              self.conv_list.append(
                  ConvBNRelu(
                      out_planes // int(math.pow(2, idx)),
                      out_planes // int(math.pow(2, idx)),
                  )
              )
  
imports: from typing import Union, List, Tuple
  import math
  import paddle
  import paddle.nn
  import stdc1_seg_cityscapes.layers
label_desc: Use image node_id 1 to create a new AddBottleneck object from inherited base classes: nn with example: obj = AddBottleneck(in_planes, out_planes, block_num, stride)