class_docstr: Handle empty batch dimension to AdaptiveAvgPool2d.
class_docstr_tok: ["Handle","empty","batch","dimension","to","AdaptiveAvgPool2d","."]
code: def forward(self, x):
      # PyTorch 1.9 does not support empty tensor inference yet
      if x.numel() == 0 and obsolete_torch_version(
          TORCH_VERSION, (1, 9)
      ):
          output_size = self.output_size
          if isinstance(output_size, int):
              output_size = [output_size, output_size]
          else:
              output_size = [
                  v if v is not None else d
                  for v, d in zip(output_size, x.size()[-2:])
              ]
          output_size = [*x.shape[:2], *output_size]
          empty = NewEmptyTensorOp.apply(x, output_size)
          return empty
  
      return super().forward(x)
  
file_path: mmdetection/mmdet/models/layers/brick_wrappers.py
imports: import torch
  import torch.nn
  import torch.nn.functional
  from mmcv.cnn.bricks.wrappers import NewEmptyTensorOp, obsolete_torch_version
  from mmdet.registry import MODELS
label_desc: Use image node_id 1 for calling the AdaptiveAvgPool2d obj's underlying member method code with example usage: obj.forward(x) and returns: super, empty