class_docstr: Wrapper of mmdetection backbones to use in detectron2.
  
  mmdet backbones produce list/tuple of tensors, while detectron2 backbones
  produce a dict of tensors. This class wraps the given backbone to produce
  output in detectron2's convention, so it can be used in place of detectron2
  backbones.
class_docstr_tok: ["Wrapper","of","mmdetection","backbones","to","use","in","detectron2",".","mmdet","backbones","produce","list\/tuple","of","tensors",",","while","detectron2","backbones","produce","a","dict","of","tensors",".","This","class","wraps","the","given","backbone","to","produce","output","in","detectron2","'s","convention",",","so","it","can","be","used","in","place","of","detectron2","backbones","."]
code: def forward(self, x) -> Dict[str, Tensor]:
      outs = self.backbone(x)
      if self.neck is not None:
          outs = self.neck(outs)
      assert isinstance(
          outs, (list, tuple)
      ), "mmdet backbone should return a list/tuple of tensors!"
      if len(outs) != len(self._output_shapes):
          raise ValueError(
              "Length of output_shapes does not match outputs from the mmdet backbone: "
              f"{len(outs)} != {len(self._output_shapes)}"
          )
      return {k: v for k, v in zip(self._output_names, outs)}
  
imports: import itertools
  import logging
  import numpy
  from collections import OrderedDict
  from collections.abc import Mapping
  from typing import Dict, List, Optional, Tuple, Union
  import torch
  from omegaconf import DictConfig, OmegaConf
  from torch import Tensor, nn
  from detectron2.layers import ShapeSpec
  from detectron2.structures import BitMasks, Boxes, ImageList, Instances
  from detectron2.utils.events import get_event_storage
  from .backbone import Backbone
label_desc: Use image node_id 2 for calling the MMDetBackbone obj's underlying member method code with example usage: obj.forward(x) and returns: unknown