class_docstr: Randomly mask out one or more patches from a batch of images.
  
  Args:
      n_holes (int): Number of patches to cut out of each image.
      width (int): The width (in pixels) of each square patch.
      height (int): The height (in pixels) of each square patch.
docstr: Args:
      img (Tensor): Tensor image of size (B, C, H, W).
  Returns:
      Tensor: Image with n_holes of dimension length x length cut out of it.
docstr_tok: ["Args",":","img","(","Tensor",")",":","Tensor","image","of","size","(","B",",","C",",","H",",","W",")",".","Returns",":","Tensor",":","Image","with","n_holes","of","dimension","length","x","length","cut","out","of","it","."]
code: def __call__(self, img):
      """
  
      Args:
          img (Tensor): Tensor image of size (B, C, H, W).
      Returns:
          Tensor: Image with n_holes of dimension length x length cut out of it.
      """
      b = img.size(0)
      c = img.size(1)
      h = img.size(-2)
      w = img.size(-1)
  
      mask = torch.ones((b, h, w), device=img.device)
  
      for n in range(self.n_holes):
          y = torch.randint(h, (b,)).long()
          x = torch.randint(w, (b,)).long()
  
          y1 = (y - self.height // 2).clamp(0, h).int()
          y2 = (y + self.height // 2).clamp(0, h).int()
          x1 = (x - self.width // 2).clamp(0, w).int()
          x2 = (x + self.width // 2).clamp(0, w).int()
  
          for batch in range(b):
              mask[
                  batch, y1[batch] : y2[batch], x1[batch] : x2[batch]
              ] = 0
  
      mask = mask.unsqueeze(1).repeat(1, c, 1, 1)
  
      return mask
  
imports: import torchbearer
  from torchbearer import Callback
  import torch
  from torch.distributions import Beta
  from torchbearer.bases import cite
label_desc: Use image node_id 2 for calling the BatchCutout obj's underlying member method code with example usage: obj.__call__(img) and returns: mask