class_docstr: Position attention module.
class_docstr_tok: ["Position","attention","module","."]
code: def __init__(self, in_channels: int):
      super().__init__()
      mid_channels = in_channels // 8
      self.mid_channels = mid_channels
      self.in_channels = in_channels
  
      self.query_conv = nn.Conv2D(in_channels, mid_channels, 1, 1)
      self.key_conv = nn.Conv2D(in_channels, mid_channels, 1, 1)
      self.value_conv = nn.Conv2D(in_channels, in_channels, 1, 1)
  
      self.gamma = self.create_parameter(
          shape=[1],
          dtype="float32",
          default_initializer=nn.initializer.Constant(0),
      )
  
imports: import os
  from typing import Union, List, Tuple
  import paddle
  from paddle import nn
  import paddle.nn.functional
  import numpy
  from paddlehub.module.module import moduleinfo
  import paddlehub.vision.segmentation_transforms
  from paddlehub.module.cv_module import ImageSegmentationModule
  from danet_resnet50_voc.resnet import ResNet50_vd
  import danet_resnet50_voc.layers
label_desc: Use image node_id 1 to create a new PAM object from inherited base classes: nn with example: obj = PAM(in_channels)