class_docstr: The base class for 2D box types.
  
  The functions of ``BaseBoxes`` lie in three fields:
  
  - Verify the boxes shape.
  - Support tensor-like operations.
  - Define abstract functions for 2D boxes.
  
  In ``__init__`` , ``BaseBoxes`` verifies the validity of the data shape
  w.r.t ``box_dim``. The tensor with the dimension >= 2 and the length
  of the last dimension being ``box_dim`` will be regarded as valid.
  ``BaseBoxes`` will restore them at the field ``tensor``. It's necessary
  to override ``box_dim`` in subclass to guarantee the data shape is
  correct.
  
  There are many basic tensor-like functions implemented in ``BaseBoxes``.
  In most cases, users can operate ``BaseBoxes`` instance like a normal
  tensor. To protect the validity of data shape, All tensor-like functions
  cannot modify the last dimension of ``self.tensor``.
  
  When creating a new box type, users need to inherit from ``BaseBoxes``
  and override abstract methods and specify the ``box_dim``. Then, register
  the new box type by using the decorator ``register_box_type``.
  
  Args:
      data (Tensor or np.ndarray or Sequence): The box data with shape
          (..., box_dim).
      dtype (torch.dtype, Optional): data type of boxes. Defaults to None.
      device (str or torch.device, Optional): device of boxes.
          Default to None.
      clone (bool): Whether clone ``boxes`` or not. Defaults to True.
class_docstr_tok: ["The","base","class","for","2D","box","types",".","The","functions","of","``","BaseBoxes","``","lie","in","three","fields",":","-","Verify","the","boxes","shape",".","-","Support","tensor-like","operations",".","-","Define","abstract","functions","for","2D","boxes",".","In","``","__init__","``",",","``","BaseBoxes","``","verifies","the","validity","of","the","data","shape","w.r.t","``","box_dim","``",".","The","tensor","with","the","dimension",">","=","2","and","the","length","of","the","last","dimension","being","``","box_dim","``","will","be","regarded","as","valid",".","``","BaseBoxes","``","will","restore","them","at","the","field","``","tensor","``",".","It","'s","necessary","to","override","``","box_dim","``","in","subclass","to","guarantee","the","data","shape","is","correct",".","There","are","many","basic","tensor-like","functions","implemented","in","``","BaseBoxes","``",".","In","most","cases",",","users","can","operate","``","BaseBoxes","``","instance","like","a","normal","tensor",".","To","protect","the","validity","of","data","shape",",","All","tensor-like","functions","can","not","modify","the","last","dimension","of","``","self.tensor","``",".","When","creating","a","new","box","type",",","users","need","to","inherit","from","``","BaseBoxes","``","and","override","abstract","methods","and","specify","the","``","box_dim","``",".","Then",",","register","the","new","box","type","by","using","the","decorator","``","register_box_type","``",".","Args",":","data","(","Tensor","or","np.ndarray","or","Sequence",")",":","The","box","data","with","shape","(","...",",","box_dim",")",".","dtype","(","torch.dtype",",","Optional",")",":","data","type","of","boxes",".","Defaults","to","None",".","device","(","str","or","torch.device",",","Optional",")",":","device","of","boxes",".","Default","to","None",".","clone","(","bool",")",":","Whether","clone","``","boxes","``","or","not",".","Defaults","to","True","."]
docstr: Reload ``clone`` from self.tensor.
code: def clone(self: T) -> T:
      """Reload ``clone`` from self.tensor."""
      return type(self)(self.tensor)
  
imports: from abc import ABCMeta, abstractmethod, abstractproperty, abstractstaticmethod
  from typing import List, Optional, Sequence, Tuple, Type, TypeVar, Union
  import numpy
  import torch
  from torch import BoolTensor, Tensor
  from mmdet.structures.mask.structures import BitmapMasks, PolygonMasks
label_desc: Use image node_id 25 for calling the BaseBoxes obj's underlying member method code with example usage: obj.clone() and returns: type