class_docstr: Global Context Extractor for CGNet.
  
  This class is employed to refine the joint feature of both local feature
  and surrounding context.
  
  Args:
      channel (int): Number of input feature channels.
      reduction (int): Reductions for global context extractor. Default: 16.
      with_cp (bool): Use checkpoint or not. Using checkpoint will save some
          memory while slowing down the training speed. Default: False.
class_docstr_tok: ["Global","Context","Extractor","for","CGNet",".","This","class","is","employed","to","refine","the","joint","feature","of","both","local","feature","and","surrounding","context",".","Args",":","channel","(","int",")",":","Number","of","input","feature","channels",".","reduction","(","int",")",":","Reductions","for","global","context","extractor",".","Default",":","16.","with_cp","(","bool",")",":","Use","checkpoint","or","not",".","Using","checkpoint","will","save","some","memory","while","slowing","down","the","training","speed",".","Default",":","False","."]
code: def forward(self, x):
      def _inner_forward(x):
          num_batch, num_channel = x.size()[:2]
          y = self.avg_pool(x).view(num_batch, num_channel)
          y = self.fc(y).view(num_batch, num_channel, 1, 1)
          return x * y
  
      if self.with_cp and x.requires_grad:
          out = cp.checkpoint(_inner_forward, x)
      else:
          out = _inner_forward(x)
  
      return out
  
imports: import torch
  import torch.nn
  import torch.utils.checkpoint
  from annotator.uniformer.mmcv.cnn import ConvModule, build_conv_layer, build_norm_layer, constant_init, kaiming_init
  from annotator.uniformer.mmcv.runner import load_checkpoint
  from annotator.uniformer.mmcv.utils.parrots_wrapper import _BatchNorm
  from annotator.uniformer.mmseg.utils import get_root_logger
  from ..builder import BACKBONES
label_desc: Use image node_id 2 for calling the GlobalContextExtractor obj's underlying member method code with example usage: obj.forward(x) and returns: out, unknown