class_docstr: This is a thin wrapper around D2's backbone to provide padding masking
class_docstr_tok: ["This","is","a","thin","wrapper","around","D2","'s","backbone","to","provide","padding","masking"]
code: def mask_out_padding(self, feature_shapes, image_sizes, device):
      masks = []
      assert len(feature_shapes) == len(self.feature_strides)
      for idx, shape in enumerate(feature_shapes):
          N, _, H, W = shape
          masks_per_feature_level = torch.ones(
              (N, H, W), dtype=torch.bool, device=device
          )
          for img_idx, (h, w) in enumerate(image_sizes):
              masks_per_feature_level[
                  img_idx,
                  : int(np.ceil(float(h) / self.feature_strides[idx])),
                  : int(np.ceil(float(w) / self.feature_strides[idx])),
              ] = 0
          masks.append(masks_per_feature_level)
      return masks
  
imports: import logging
  import math
  from typing import List
  import numpy
  import torch
  import torch.distributed
  import torch.nn.functional
  from scipy.optimize import linear_sum_assignment
  from torch import nn
  from detectron2.layers import ShapeSpec
  from detectron2.modeling import META_ARCH_REGISTRY, build_backbone, detector_postprocess
  from detectron2.structures import Boxes, ImageList, Instances, BitMasks, PolygonMasks
  from detectron2.utils.logger import log_first_n
  from fvcore.nn import giou_loss, smooth_l1_loss
  from models.backbone import Joiner
  from models.detr import DETR, SetCriterion
  from models.matcher import HungarianMatcher
  from models.position_encoding import PositionEmbeddingSine
  from models.transformer import Transformer
  from models.segmentation import DETRsegm, PostProcessPanoptic, PostProcessSegm
  from util.box_ops import box_cxcywh_to_xyxy, box_xyxy_to_cxcywh
  from util.misc import NestedTensor
  from datasets.coco import convert_coco_poly_to_mask
label_desc: Use image node_id 3 for calling the MaskedBackbone obj's underlying member method code with example usage: obj.mask_out_padding(feature_shapes, image_sizes, device) and returns: masks