class_docstr: Regular bottlenecks are the main building block of ENet.
  Main branch:
  1. Shortcut connection.
  Extension branch:
  1. 1x1 convolution which decreases the number of channels by
      ``internal_ratio``, also called a projection;
  2. regular, dilated or asymmetric convolution;
  3. 1x1 convolution which increases the number of channels back to
      ``channels``, also called an expansion;
  4. dropout as a regularizer.
  
  Args:
      channels (int): the number of input and output channels.
      internal_ratio (int, optional): a scale factor applied to
          ``channels`` used to compute the number of
          channels after the projection. eg. given ``channels`` equal to 128 and
          internal_ratio equal to 2 the number of channels after the projection
          is 64. Default: 4.
      kernel_size (int, optional): the kernel size of the filters used in
          the convolution layer described above in item 2 of the extension
          branch. Default: 3.
      padding (int, optional): zero-padding added to both sides of the
          input. Default: 0.
      dilation (int, optional): spacing between kernel elements for the
          convolution described in item 2 of the extension branch. Default: 1.
          asymmetric (bool, optional): flags if the convolution described in
          item 2 of the extension branch is asymmetric or not. Default: False.
      dropout_prob (float, optional): probability of an element to be
          zeroed. Default: 0 (no dropout).
      bias (bool, optional): Adds a learnable bias to the output if
          ``True``. Default: False.
      relu (bool, optional): When ``True`` ReLU is used as the activation
          function; otherwise, PReLU is used. Default: True.
class_docstr_tok: ["Regular","bottlenecks","are","the","main","building","block","of","ENet",".","Main","branch",":","1",".","Shortcut","connection",".","Extension","branch",":","1",".","1x1","convolution","which","decreases","the","number","of","channels","by","``","internal_ratio","``",",","also","called","a","projection",";","2.","regular",",","dilated","or","asymmetric","convolution",";","3",".","1x1","convolution","which","increases","the","number","of","channels","back","to","``","channels","``",",","also","called","an","expansion",";","4.","dropout","as","a","regularizer",".","Args",":","channels","(","int",")",":","the","number","of","input","and","output","channels",".","internal_ratio","(","int",",","optional",")",":","a","scale","factor","applied","to","``","channels","``","used","to","compute","the","number","of","channels","after","the","projection",".","eg",".","given","``","channels","``","equal","to","128","and","internal_ratio","equal","to","2","the","number","of","channels","after","the","projection","is","64",".","Default",":","4.","kernel_size","(","int",",","optional",")",":","the","kernel","size","of","the","filters","used","in","the","convolution","layer","described","above","in","item","2","of","the","extension","branch",".","Default",":","3.","padding","(","int",",","optional",")",":","zero-padding","added","to","both","sides","of","the","input",".","Default",":","0.","dilation","(","int",",","optional",")",":","spacing","between","kernel","elements","for","the","convolution","described","in","item","2","of","the","extension","branch",".","Default",":","1.","asymmetric","(","bool",",","optional",")",":","flags","if","the","convolution","described","in","item","2","of","the","extension","branch","is","asymmetric","or","not",".","Default",":","False",".","dropout_prob","(","float",",","optional",")",":","probability","of","an","element","to","be","zeroed",".","Default",":","0","(","no","dropout",")",".","bias","(","bool",",","optional",")",":","Adds","a","learnable","bias","to","the","output","if","``","True","``",".","Default",":","False",".","relu","(","bool",",","optional",")",":","When","``","True","``","ReLU","is","used","as","the","activation","function",";","otherwise",",","PReLU","is","used",".","Default",":","True","."]
code: def __init__(
      self,
      channels,
      internal_ratio=4,
      kernel_size=3,
      padding=0,
      dilation=1,
      asymmetric=False,
      dropout_prob=0,
      bias=False,
      relu=True,
  ):
      super(RegularBottleneck, self).__init__()
  
      if internal_ratio <= 1 or internal_ratio > channels:
          raise RuntimeError(
              "Value out of range. Expected value in the "
              "interval [1, {0}], got internal_scale={1}.".format(
                  channels, internal_ratio
              )
          )
  
      internal_channels = channels // internal_ratio
  
      if relu:
          activation = nn.ReLU
      else:
          activation = nn.PReLU
  
      self.ext_conv1 = nn.Sequential(
          nn.Conv2D(
              channels,
              internal_channels,
              kernel_size=1,
              stride=1,
              bias_attr=bias,
          ),
          layers.SyncBatchNorm(internal_channels),
          activation(),
      )
  
      if asymmetric:
          self.ext_conv2 = nn.Sequential(
              nn.Conv2D(
                  internal_channels,
                  internal_channels,
                  kernel_size=(kernel_size, 1),
                  stride=1,
                  padding=(padding, 0),
                  dilation=dilation,
                  bias_attr=bias,
              ),
              layers.SyncBatchNorm(internal_channels),
              activation(),
              nn.Conv2D(
                  internal_channels,
                  internal_channels,
                  kernel_size=(1, kernel_size),
                  stride=1,
                  padding=(0, padding),
                  dilation=dilation,
                  bias_attr=bias,
              ),
              layers.SyncBatchNorm(internal_channels),
              activation(),
          )
      else:
          self.ext_conv2 = nn.Sequential(
              nn.Conv2D(
                  internal_channels,
                  internal_channels,
                  kernel_size=kernel_size,
                  stride=1,
                  padding=padding,
                  dilation=dilation,
                  bias_attr=bias,
              ),
              layers.SyncBatchNorm(internal_channels),
              activation(),
          )
  
      self.ext_conv3 = nn.Sequential(
          nn.Conv2D(
              internal_channels,
              channels,
              kernel_size=1,
              stride=1,
              bias_attr=bias,
          ),
          layers.SyncBatchNorm(channels),
          activation(),
      )
  
      self.ext_regul = nn.Dropout2D(p=dropout_prob)
  
      self.out_activation = activation()
  
imports: import paddle
  import paddle.nn
  import paddle.nn.functional
  from paddleseg import utils
  from paddleseg.models import layers
  from paddleseg.cvlibs import manager, param_init
label_desc: Use image node_id 1 to create a new RegularBottleneck object from inherited base classes: nn with example: obj = RegularBottleneck(channels, internal_ratio, kernel_size, padding, dilation, asymmetric, dropout_prob, bias, relu)