class_docstr: This class stores the segmentation masks for all objects in one image, in
  the form of bitmaps.
  
  Attributes:
      tensor: bool Tensor of N,H,W, representing N instances in the image.
class_docstr_tok: ["This","class","stores","the","segmentation","masks","for","all","objects","in","one","image",",","in","the","form","of","bitmaps",".","Attributes",":","tensor",":","bool","Tensor","of","N",",","H",",","W",",","representing","N","instances","in","the","image","."]
docstr: Args:
      tensor: bool Tensor of N,H,W, representing N instances in the image.
docstr_tok: ["Args",":","tensor",":","bool","Tensor","of","N",",","H",",","W",",","representing","N","instances","in","the","image","."]
code: def __init__(self, tensor: Union[torch.Tensor, np.ndarray]):
      """
      Args:
          tensor: bool Tensor of N,H,W, representing N instances in the image.
      """
      device = (
          tensor.device
          if isinstance(tensor, torch.Tensor)
          else torch.device("cpu")
      )
      tensor = torch.as_tensor(tensor, dtype=torch.bool, device=device)
      assert tensor.dim() == 3, tensor.size()
      self.image_size = tensor.shape[1:]
      self.tensor = tensor
  
imports: import copy
  import itertools
  from typing import Any, Iterator, List, Union
  import numpy
  import torch
  import torchvision
  from .boxes import Boxes
label_desc: Use image node_id 1 to create a new BitMasks object  with example: obj = BitMasks(tensor)