class_docstr: The DNLNet head.
  
  Args:
      num_classes (int): The unique number of target classes.
      in_channels (tuple): The number of input channels.
      reduction (int): Reduction factor of projection transform. Default: 2.
      use_scale (bool): Whether to scale pairwise_weight by
          sqrt(1/inter_channels). Default: False.
      mode (str): The nonlocal mode. Options are 'embedded_gaussian',
          'dot_product'. Default: 'embedded_gaussian.'.
      temperature (float): Temperature to adjust attention. Default: 0.05
      concat_input (bool): Whether concat the input and output of convs before classification layer. Default: True
      enable_auxiliary_loss (bool, optional): A bool value indicates whether adding auxiliary loss. Default: True.
class_docstr_tok: ["The","DNLNet","head",".","Args",":","num_classes","(","int",")",":","The","unique","number","of","target","classes",".","in_channels","(","tuple",")",":","The","number","of","input","channels",".","reduction","(","int",")",":","Reduction","factor","of","projection","transform",".","Default",":","2.","use_scale","(","bool",")",":","Whether","to","scale","pairwise_weight","by","sqrt","(","1\/inter_channels",")",".","Default",":","False",".","mode","(","str",")",":","The","nonlocal","mode",".","Options","are","'embedded_gaussian","'",",","'dot_product","'",".","Default",":","'embedded_gaussian.","'",".","temperature","(","float",")",":","Temperature","to","adjust","attention",".","Default",":","0.05","concat_input","(","bool",")",":","Whether","concat","the","input","and","output","of","convs","before","classification","layer",".","Default",":","True","enable_auxiliary_loss","(","bool",",","optional",")",":","A","bool","value","indicates","whether","adding","auxiliary","loss",".","Default",":","True","."]
code: def __init__(
      self,
      num_classes,
      in_channels,
      reduction,
      use_scale,
      mode,
      temperature,
      concat_input=True,
      enable_auxiliary_loss=True,
      **kwargs,
  ):
      super(DNLHead, self).__init__()
      self.in_channels = in_channels[-1]
      self.concat_input = concat_input
      self.enable_auxiliary_loss = enable_auxiliary_loss
      inter_channels = self.in_channels // 4
  
      self.dnl_block = DisentangledNonLocal2D(
          in_channels=inter_channels,
          reduction=reduction,
          use_scale=use_scale,
          temperature=temperature,
          mode=mode,
      )
      self.conv0 = layers.ConvBNReLU(
          in_channels=self.in_channels,
          out_channels=inter_channels,
          kernel_size=3,
          bias_attr=False,
      )
      self.conv1 = layers.ConvBNReLU(
          in_channels=inter_channels,
          out_channels=inter_channels,
          kernel_size=3,
          bias_attr=False,
      )
      self.cls = nn.Sequential(
          nn.Dropout2D(p=0.1), nn.Conv2D(inter_channels, num_classes, 1)
      )
      self.aux = nn.Sequential(
          layers.ConvBNReLU(
              in_channels=1024,
              out_channels=256,
              kernel_size=3,
              bias_attr=False,
          ),
          nn.Dropout2D(p=0.1),
          nn.Conv2D(256, num_classes, 1),
      )
      if self.concat_input:
          self.conv_cat = layers.ConvBNReLU(
              self.in_channels + inter_channels,
              inter_channels,
              kernel_size=3,
              bias_attr=False,
          )
  
imports: import paddle
  import paddle.nn
  import paddle.nn.functional
  from paddleseg.models import layers
  from paddleseg.cvlibs import manager
  from paddleseg.utils import utils
label_desc: Use image node_id 1 to create a new DNLHead object from inherited base classes: nn with example: obj = DNLHead(num_classes, in_channels, reduction, use_scale, mode, temperature, concat_input, enable_auxiliary_loss)