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 __init__(self, channel, reduction=16, with_cp=False):
      super(GlobalContextExtractor, self).__init__()
      self.channel = channel
      self.reduction = reduction
      assert reduction >= 1 and channel >= reduction
      self.with_cp = with_cp
      self.avg_pool = nn.AdaptiveAvgPool2d(1)
      self.fc = nn.Sequential(
          nn.Linear(channel, channel // reduction),
          nn.ReLU(inplace=True),
          nn.Linear(channel // reduction, channel),
          nn.Sigmoid(),
      )
  
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 1 to create a new GlobalContextExtractor object from inherited base classes: nn with example: obj = GlobalContextExtractor(channel, reduction, with_cp)