class_docstr: Base class for instance masks.
class_docstr_tok: ["Base","class","for","instance","masks","."]
docstr: Convert masks to the format of Tensor.
  
  Args:
      dtype (str): Dtype of converted mask.
      device (torch.device): Device of converted masks.
  
  Returns:
      Tensor: Converted masks in the format of Tensor.
docstr_tok: ["Convert","masks","to","the","format","of","Tensor",".","Args",":","dtype","(","str",")",":","Dtype","of","converted","mask",".","device","(","torch.device",")",":","Device","of","converted","masks",".","Returns",":","Tensor",":","Converted","masks","in","the","format","of","Tensor","."]
code: def to_tensor(self, dtype, device):
      """Convert masks to the format of Tensor.
  
      Args:
          dtype (str): Dtype of converted mask.
          device (torch.device): Device of converted masks.
  
      Returns:
          Tensor: Converted masks in the format of Tensor.
      """
      pass
  
imports: from abc import ABCMeta, abstractmethod
  import cv2
  import mmcv
  import numpy
  import pycocotools.mask
  import torch
  from mmcv.ops.roi_align import roi_align
label_desc: Use image node_id 10 for calling the BaseInstanceMasks obj's underlying member method code with example usage: obj.to_tensor(dtype, device) without return types