code: def __init__(
      self,
      in_c,
      mid_c,
      out_c,
      filter_size,
      stride,
      use_se,
      act=None,
      dilation=1,
  ):
      super().__init__()
      self.if_shortcut = stride == 1 and in_c == out_c
      self.if_se = use_se
      self.in_c = in_c
      self.mid_c = mid_c
  
      # There is not expand conv in pytorch version when in_c equaled to mid_c.
  
      if in_c != mid_c:
          self.expand_conv = ConvBNLayer(
              in_c=in_c,
              out_c=mid_c,
              filter_size=1,
              stride=1,
              padding=0,
              if_act=True,
              act=act,
          )
      self.bottleneck_conv = ConvBNLayer(
          in_c=mid_c,
          out_c=mid_c,
          filter_size=filter_size,
          stride=stride,
          padding=int((filter_size - 1) // 2) * dilation,
          num_groups=mid_c,
          if_act=True,
          act=act,
          dilation=dilation,
      )
      if self.if_se:
          self.mid_se = SEModule(mid_c)
      self.linear_conv = ConvBNLayer(
          in_c=mid_c,
          out_c=out_c,
          filter_size=1,
          stride=1,
          padding=0,
          if_act=False,
          act=None,
      )
  
imports: import paddle
  import paddle.nn
  from paddle import ParamAttr
  from paddle.regularizer import L2Decay
  from paddle.nn import AdaptiveAvgPool2D, BatchNorm, Conv2D, Dropout, Linear
  from paddleseg.cvlibs import manager
  from paddleseg.utils import utils, logger
  from paddleseg.models import layers
label_desc: Use image node_id 1 to create a new ResidualUnit object from inherited base classes: nn with example: obj = ResidualUnit(in_c, mid_c, out_c, filter_size, stride, use_se, act, dilation)