class_docstr: A building block for ResNets.
  
  in --> Bottleneck with residual_conv --> Bottleneck * (n_layer - 1) --> out
  
  Args:
      n_layer (int): The number of layers used in the building block.
      in_channels (int): The number of channels of the input array.
      mid_channels (int): The number of channels of intermediate arrays.
      out_channels (int): The number of channels of the output array.
      stride (int or tuple of ints): Stride of filter application.
      dilate (int or tuple of ints): Dilation factor of filter applications.
          :obj:`dilate=d` and :obj:`dilate=(d, d)` are equivalent.
      groups (int): The number of groups to use grouped convolution in the
          second layer of each bottleneck. The default is one, where
          grouped convolution is not used.
      initialW (callable): Initial weight value used in
          the convolutional layers.
      bn_kwargs (dict): Keyword arguments passed to initialize
          :class:`chainer.links.BatchNormalization`.
      stride_first (bool): This determines the behavior of the
          bottleneck with a shortcut. If :obj:`True`, apply strided
          convolution with the first convolution layer.
          Otherwise, apply strided convolution with the
          second convolution layer.
      add_seblock (bool): If :obj:`True`, apply a squeeze-and-excitation
          block to each residual block.
code: def __init__(
      self,
      n_layer,
      in_channels,
      mid_channels,
      out_channels,
      stride,
      dilate=1,
      groups=1,
      initialW=None,
      bn_kwargs={},
      stride_first=False,
      add_seblock=False,
  ):
      super(ResBlock, self).__init__()
      # Dilate option is applied to all bottlenecks.
      with self.init_scope():
          self.a = Bottleneck(
              in_channels,
              mid_channels,
              out_channels,
              stride,
              dilate,
              groups,
              initialW,
              bn_kwargs=bn_kwargs,
              residual_conv=True,
              stride_first=stride_first,
              add_seblock=add_seblock,
          )
          for i in range(n_layer - 1):
              name = "b{}".format(i + 1)
              bottleneck = Bottleneck(
                  out_channels,
                  mid_channels,
                  out_channels,
                  stride=1,
                  dilate=dilate,
                  initialW=initialW,
                  bn_kwargs=bn_kwargs,
                  residual_conv=False,
                  add_seblock=add_seblock,
                  groups=groups,
              )
              setattr(self, name, bottleneck)
  
file_path: chainercv/chainercv/links/model/resnet/resblock.py
imports: import chainer
  import chainer.functions
  from chainercv.links import Conv2DBNActiv
  from chainercv.links import PickableSequentialChain
  from chainercv.links import SEBlock
label_desc: Use image node_id 1 to create a new ResBlock object from inherited base classes: PickableSequentialChain with example: obj = ResBlock(n_layer, in_channels, mid_channels, out_channels, stride, dilate, groups, initialW, bn_kwargs, stride_first, add_seblock)