class_docstr: General self-attention block/non-local block.
  
  Args:
       in_channels (int): Input channels of key/query feature.
       channels (int): Output channels of key/query transform.
class_docstr_tok: ["General","self-attention","block\/non-local","block",".","Args",":","in_channels","(","int",")",":","Input","channels","of","key\/query","feature",".","channels","(","int",")",":","Output","channels","of","key\/query","transform","."]
code: def __init__(self, in_channels, channels):
      super(SelfAttentionBlock, self).__init__(
          key_in_channels=in_channels,
          query_in_channels=in_channels,
          channels=channels,
          out_channels=in_channels,
          share_key_query=False,
          query_downsample=None,
          key_downsample=None,
          key_query_num_convs=2,
          key_query_norm=True,
          value_out_num_convs=1,
          value_out_norm=False,
          matmul_norm=True,
          with_out=False,
      )
  
      self.output_project = self.build_project(
          in_channels, in_channels, num_convs=1, use_conv_module=True
      )
  
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 isanet_resnet50_voc.resnet import ResNet50_vd
  import isanet_resnet50_voc.layers
label_desc: Use image node_id 1 to create a new SelfAttentionBlock object from inherited base classes: layers with example: obj = SelfAttentionBlock(in_channels, channels)