class_docstr: Basic Non-local module.
  This model is the implementation of "Non-local Neural Networks"
  (https://arxiv.org/abs/1711.07971)
  
  Args:
      in_channels (int): Channels of the input feature map.
      reduction (int): Channel reduction ratio. Default: 2.
      use_scale (bool): Whether to scale pairwise_weight by `1/sqrt(inter_channels)` when the mode is `embedded_gaussian`. Default: True.
      sub_sample (bool): Whether to utilize max pooling after pairwise function. Default: False.
      mode (str): Options are `gaussian`, `concatenation`, `embedded_gaussian` and `dot_product`. Default: embedded_gaussian.
code: def concatenation(self, theta_x, phi_x):
      h = theta_x.shape[2]
      w = phi_x.shape[3]
      theta_x = paddle.tile(theta_x, [1, 1, 1, w])
      phi_x = paddle.tile(phi_x, [1, 1, h, 1])
  
      concat_feature = paddle.concat([theta_x, phi_x], axis=1)
      pairwise_weight = self.concat_project(concat_feature)
      n, _, h, w = pairwise_weight.shape
      pairwise_weight = paddle.reshape(pairwise_weight, [n, h, w])
      pairwise_weight /= pairwise_weight.shape[-1]
      return pairwise_weight
  
file_path: PaddleSeg/paddleseg/models/layers/nonlocal2d.py
imports: import paddle
  import paddle.nn
  import paddle.nn.functional
  from paddleseg.models import layers
label_desc: Use image node_id 5 for calling the NonLocal2D obj's underlying member method code with example usage: obj.concatenation(theta_x, phi_x) and returns: pairwise_weight