class_docstr: Representing a list of detectron2.structures.Boxes from minibatch, each box
  is represented by a 5d vector (batch index + 4 coordinates), or a 6d vector
  (batch index + 5 coordinates) for RotatedBoxes.
class_docstr_tok: ["Representing","a","list","of","detectron2.structures.Boxes","from","minibatch",",","each","box","is","represented","by","a","5d","vector","(","batch","index","+","4","coordinates",")",",","or","a","6d","vector","(","batch","index","+","5","coordinates",")","for","RotatedBoxes","."]
code: def __init__(self, tensor):
      assert isinstance(tensor, torch.Tensor)
      assert tensor.dim() == 2 and tensor.size(-1) in [
          4,
          5,
          6,
      ], tensor.size()
      # TODO: make tensor immutable when dim is Nx5 for Boxes,
      # and Nx6 for RotatedBoxes?
      self.tensor = tensor
  
imports: import math
  from typing import Dict
  import torch
  import torch.nn.functional
  from detectron2.layers import ShapeSpec, cat
  from detectron2.layers.roi_align_rotated import ROIAlignRotated
  from detectron2.modeling import poolers
  from detectron2.modeling.proposal_generator import rpn
  from detectron2.modeling.roi_heads.mask_head import mask_rcnn_inference
  from detectron2.structures import Boxes, ImageList, Instances, Keypoints, RotatedBoxes
  from .shared import alias, to_device
label_desc: Use image node_id 1 to create a new Caffe2Boxes object from inherited base classes: Boxes with example: obj = Caffe2Boxes(tensor)