class_docstr: Self-Attention Block for AFNB module.
  
  Args:
      low_in_channels (int): Low-level-feature channels.
      high_in_channels (int): High-level-feature channels.
      key_channels (int): The key channels in self-attention block.
      value_channels (int): The value channels in self-attention block.
      out_channels (int, optional): Out channels of AFNB module. Default: None.
      scale (int, optional): Pooling size. Default: 1.
      psp_size (tuple, optional): The out size of pooled feature maps. Default: (1, 3, 6, 8).
code: def __init__(
      self,
      low_in_channels: int,
      high_in_channels: int,
      key_channels: int,
      value_channels: int,
      out_channels: int = None,
      scale: int = 1,
      psp_size: Tuple[int] = (1, 3, 6, 8),
  ):
      super().__init__()
  
      self.scale = scale
      self.in_channels = low_in_channels
      self.out_channels = out_channels
      self.key_channels = key_channels
      self.value_channels = value_channels
      if out_channels == None:
          self.out_channels = high_in_channels
      self.pool = nn.MaxPool2D(scale)
      self.f_key = layers.ConvBNReLU(
          in_channels=low_in_channels,
          out_channels=key_channels,
          kernel_size=1,
      )
      self.f_query = layers.ConvBNReLU(
          in_channels=high_in_channels,
          out_channels=key_channels,
          kernel_size=1,
      )
      self.f_value = nn.Conv2D(
          in_channels=low_in_channels,
          out_channels=value_channels,
          kernel_size=1,
      )
  
      self.W = nn.Conv2D(
          in_channels=value_channels,
          out_channels=out_channels,
          kernel_size=1,
      )
  
      self.psp_size = psp_size
  
imports: import os
  from typing import Union, List, Tuple
  import numpy
  import paddle
  import paddle.nn
  import paddle.nn.functional
  from paddlehub.module.module import moduleinfo
  import paddlehub.vision.segmentation_transforms
  from paddlehub.module.cv_module import ImageSegmentationModule
  from ann_resnet50_voc.resnet import ResNet50_vd
  import ann_resnet50_voc.layers
label_desc: Use image node_id 1 to create a new SelfAttentionBlock_AFNB object from inherited base classes: nn with example: obj = SelfAttentionBlock_AFNB(low_in_channels, high_in_channels, key_channels, value_channels, out_channels, scale, psp_size)