class_docstr: YOLACT mask head used in https://arxiv.org/abs/1904.02689.
  
  This head outputs the mask prototypes for YOLACT.
  
  Args:
      in_channels (int): Number of channels in the input feature map.
      proto_channels (tuple[int]): Output channels of protonet convs.
      proto_kernel_sizes (tuple[int]): Kernel sizes of protonet convs.
      include_last_relu (Bool): If keep the last relu of protonet.
      num_protos (int): Number of prototypes.
      num_classes (int): Number of categories excluding the background
          category.
      loss_mask_weight (float): Reweight the mask loss by this factor.
      max_masks_to_train (int): Maximum number of masks to train for
          each image.
docstr: Crop predicted masks by zeroing out everything not in the predicted
  bbox.
  
  Args:
      masks (Tensor): shape [H, W, N].
      boxes (Tensor): bbox coords in relative point form with
          shape [N, 4].
  
  Return:
      Tensor: The cropped masks.
docstr_tok: ["Crop","predicted","masks","by","zeroing","out","everything","not","in","the","predicted","bbox",".","Args",":","masks","(","Tensor",")",":","shape","[","H",",","W",",","N","]",".","boxes","(","Tensor",")",":","bbox","coords","in","relative","point","form","with","shape","[","N",",","4","]",".","Return",":","Tensor",":","The","cropped","masks","."]
code: def crop(self, masks, boxes, padding=1):
      """Crop predicted masks by zeroing out everything not in the predicted
      bbox.
  
      Args:
          masks (Tensor): shape [H, W, N].
          boxes (Tensor): bbox coords in relative point form with
              shape [N, 4].
  
      Return:
          Tensor: The cropped masks.
      """
      h, w, n = masks.size()
      x1, x2 = self.sanitize_coordinates(
          boxes[:, 0], boxes[:, 2], w, padding, cast=False
      )
      y1, y2 = self.sanitize_coordinates(
          boxes[:, 1], boxes[:, 3], h, padding, cast=False
      )
  
      rows = (
          torch.arange(w, device=masks.device, dtype=x1.dtype)
          .view(1, -1, 1)
          .expand(h, w, n)
      )
      cols = (
          torch.arange(h, device=masks.device, dtype=x1.dtype)
          .view(-1, 1, 1)
          .expand(h, w, n)
      )
  
      masks_left = rows >= x1.view(1, 1, -1)
      masks_right = rows < x2.view(1, 1, -1)
      masks_up = cols >= y1.view(1, 1, -1)
      masks_down = cols < y2.view(1, 1, -1)
  
      crop_mask = masks_left * masks_right * masks_up * masks_down
  
      return masks * crop_mask.float()
  
imports: import numpy
  import torch
  import torch.nn
  import torch.nn.functional
  from mmcv.cnn import ConvModule, xavier_init
  from mmcv.runner import force_fp32
  from mmdet.core import build_sampler, fast_nms, images_to_levels, multi_apply
  from ..builder import HEADS, build_loss
  from .anchor_head import AnchorHead
label_desc: Use image node_id 8 for calling the YOLACTProtonet obj's underlying member method code with example usage: obj.crop(masks, boxes, padding) and returns: unknown