class_docstr: The original article refers to refer to https://arxiv.org/pdf/2107.00782
  
  Args:
      inplanes (int): Input channels of feature.
      planes (int): Output channels of feature.
      kernel_size (int, optional): The kernel size of Conv2D. Default: 1
      stride (int, optional): The stride length of Conv2D. Default: 1
code: def spatial_pool(self, x):
      input_x = self.conv_v_right(x)
      batch, _, height, width = paddle.shape(input_x)
      input_x = input_x.reshape(
          (batch, self.inter_planes, height * width)
      )
      context_mask = self.conv_q_right(x)
      context_mask = context_mask.reshape((batch, 1, height * width))
      context_mask = self.softmax_right(context_mask)
      context = paddle.matmul(
          input_x, context_mask.transpose((0, 2, 1))
      )
      context = context.unsqueeze(-1)
      context = self.conv_up(context)
      mask_ch = self.sigmoid(context)
      out = x * mask_ch
      return out
  
file_path: PaddleSeg/paddleseg/models/layers/polaried_self_attention.py
imports: import paddle
  import paddle.nn
  from paddleseg.cvlibs import param_init
label_desc: Use image node_id 2 for calling the PolarizedSelfAttentionModule obj's underlying member method code with example usage: obj.spatial_pool(x) and returns: out