class_docstr: Global Average Pooling neck.
  
  Note that we use `view` to remove extra channel after pooling. We do not
  use `squeeze` as it will also remove the batch dimension when the tensor
  has a batch dimension of size 1, which can lead to unexpected errors.
code: def __init__(self, kernel_size=None, stride=None):
      super(GlobalAveragePooling, self).__init__()
      if kernel_size is None and stride is None:
          self.gap = nn.AdaptiveAvgPool2d((1, 1))
      else:
          self.gap = nn.AvgPool2d(kernel_size, stride)
  
file_path: mmdetection/mmdet/models/reid/gap.py
imports: import torch
  import torch.nn
  from mmengine.model import BaseModule
  from mmdet.registry import MODELS
label_desc: Use image node_id 1 to create a new GlobalAveragePooling object from inherited base classes: BaseModule with example: obj = GlobalAveragePooling(kernel_size, stride)