class_docstr: Global Context Block implementation.
  
  Args:
      in_channels (int): The input channels of Global Context Block.
      ratio (float): The channels of attention map.
class_docstr_tok: ["Global","Context","Block","implementation",".","Args",":","in_channels","(","int",")",":","The","input","channels","of","Global","Context","Block",".","ratio","(","float",")",":","The","channels","of","attention","map","."]
code: def global_context_block(self, x):
      x_shape = paddle.shape(x)
  
      # [N, C, H * W]
      input_x = paddle.reshape(x, shape=[0, self.gc_channels, -1])
      # [N, 1, C, H * W]
      input_x = paddle.unsqueeze(input_x, axis=1)
      # [N, 1, H, W]
      context_mask = self.conv_mask(x)
      # [N, 1, H * W]
      context_mask = paddle.reshape(context_mask, shape=[0, 1, -1])
      context_mask = self.softmax(context_mask)
      # [N, 1, H * W, 1]
      context_mask = paddle.unsqueeze(context_mask, axis=-1)
      # [N, 1, C, 1]
      context = paddle.matmul(input_x, context_mask)
      # [N, C, 1, 1]
      context = paddle.reshape(
          context, shape=[0, self.gc_channels, 1, 1]
      )
  
      return context
  
imports: import paddle
  import paddle.nn
  import paddle.nn.functional
  from paddleseg.cvlibs import manager
  from paddleseg.models import layers
  from paddleseg.utils import utils
label_desc: Use image node_id 2 for calling the GlobalContextBlock obj's underlying member method code with example usage: obj.global_context_block(x) and returns: context