class_docstr: Position attention module
  from the paper `"Dual Attention Network for Scene Segmentation"
  <https://arxiv.org/abs/1809.02983>`
  PAM_Module captures long-range spatial contextual information.
class_docstr_tok: ["Position","attention","module","from","the","paper","`","``","Dual","Attention","Network","for","Scene","Segmentation","''","<","https",":","\/\/arxiv.org\/abs\/1809.02983",">","`","PAM_Module","captures","long-range","spatial","contextual","information","."]
code: def __init__(self, in_dim):
      super(PAM_Module, self).__init__()
      self.chanel_in = in_dim
  
      self.query_conv = nn.Conv2D(
          in_channels=in_dim, channels=in_dim // 8, kernel_size=(1, 1)
      )
      self.key_conv = nn.Conv2D(
          in_channels=in_dim, channels=in_dim // 8, kernel_size=(1, 1)
      )
      self.value_conv = nn.Conv2D(
          in_channels=in_dim, channels=in_dim, kernel_size=(1, 1)
      )
      self.gamma = self.params.get(
          "gamma", shape=(1,), init=mx.init.Zero()
      )
  
file_path: gluon-cv/gluoncv/model_zoo/attention.py
imports: import mxnet
  from mxnet.gluon import nn
  from mxnet.gluon.nn import HybridBlock
label_desc: Use image node_id 1 to create a new PAM_Module object from inherited base classes: HybridBlock with example: obj = PAM_Module(in_dim)