class_docstr: This class represents masks in the form of polygons.
  
  Polygons is a list of three levels. The first level of the list
  corresponds to objects, the second level to the polys that compose the
  object, the third level to the poly coordinates
  
  Args:
      masks (list[list[ndarray]]): The first level of the list
          corresponds to objects, the second level to the polys that
          compose the object, the third level to the poly coordinates
      height (int): height of masks
      width (int): width of masks
class_docstr_tok: ["This","class","represents","masks","in","the","form","of","polygons",".","Polygons","is","a","list","of","three","levels",".","The","first","level","of","the","list","corresponds","to","objects",",","the","second","level","to","the","polys","that","compose","the","object",",","the","third","level","to","the","poly","coordinates","Args",":","masks","(","list","[","list","[","ndarray","]","]",")",":","The","first","level","of","the","list","corresponds","to","objects",",","the","second","level","to","the","polys","that","compose","the","object",",","the","third","level","to","the","poly","coordinates","height","(","int",")",":","height","of","masks","width","(","int",")",":","width","of","masks"]
docstr: See :func:`BaseInstanceMasks.to_tensor`.
code: def to_tensor(self, dtype, device):
      """See :func:`BaseInstanceMasks.to_tensor`."""
      if len(self.masks) == 0:
          return torch.empty(
              (0, self.height, self.width), dtype=dtype, device=device
          )
      ndarray_masks = self.to_ndarray()
      return torch.tensor(ndarray_masks, dtype=dtype, device=device)
  
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 20 for calling the PolygonMasks obj's underlying member method code with example usage: obj.to_tensor(dtype, device) and returns: torch, torch