code: def _get_mask(nums, max_num):
      # non_pad_mask: b x lq, torch.float32, 0. on PAD
      batch_size = nums.size(0)
      arange = (
          torch.arange(0, max_num).unsqueeze(0).expand(batch_size, -1)
      )
      non_pad_mask = arange.to(nums.device).lt(nums.unsqueeze(-1))
      non_pad_mask = non_pad_mask.type(torch.float32)
      return non_pad_mask
  
imports: import functools
  import logging
  import math
  import torch
  import torch.nn.functional
  from mmf.common.registry import registry
  from mmf.models.base_model import BaseModel
  from mmf.modules.layers import ClassifierLayer
  from mmf.utils.build import build_image_encoder
  from omegaconf import OmegaConf
  from torch import nn
label_desc: Use image node_id 1 for calling a global function with example usage: _get_mask(nums, max_num) and returns: non_pad_mask