class_docstr: The basic implementation for self-attention block/non-local block
  Input:
      N X C X H X W
  Parameters:
      in_channels       : the dimension of the input feature map
      key_channels      : the dimension after the key/query transform
      value_channels    : the dimension after the value transform
      scale             : choose the scale to downsample the input feature maps
  Return:
      N X C X H X W
      position-aware context features.(w/o concate or add with the input)
code: def __init__(
      self,
      in_channels,
      key_channels,
      value_channels,
      out_channels=None,
      scale=1,
      abn_block=ABN,
  ):
      super(_PyramidSelfAttentionBlock, self).__init__()
      self.scale = scale
      self.in_channels = in_channels
      self.out_channels = out_channels
      self.key_channels = key_channels
      self.value_channels = value_channels
      if out_channels is None:
          self.out_channels = in_channels
      self.f_key = nn.Sequential(
          nn.Conv2d(
              in_channels=self.in_channels,
              out_channels=self.key_channels,
              kernel_size=1,
              stride=1,
              padding=0,
              bias=False,
          ),
          abn_block(self.key_channels),
      )
      self.f_query = self.f_key
      self.f_value = nn.Conv2d(
          in_channels=self.in_channels,
          out_channels=self.value_channels,
          kernel_size=1,
          stride=1,
          padding=0,
      )
      self.W = nn.Conv2d(
          in_channels=self.value_channels,
          out_channels=self.out_channels,
          kernel_size=1,
          stride=1,
          padding=0,
      )
      # nn.init.constant(self.W.weight, 0)
      nn.init.constant(self.W.bias, 0)
  
imports: import torch
  import torch.nn.functional
  from torch import nn
  from ..modules.activations import ABN
label_desc: Use image node_id 1 to create a new _PyramidSelfAttentionBlock object from inherited base classes: nn with example: obj = _PyramidSelfAttentionBlock(in_channels, key_channels, value_channels, out_channels, scale, abn_block)