code: def make_non_pad_mask(input_lengths: torch.Tensor, seq_len: int):
      """Converts input_lengths to a non-padding mask. The mask is 2D."""
      batch_size = input_lengths.shape[0]
      seq_range = torch.arange(0, seq_len, device=input_lengths.device)
      seq_range_expand = seq_range.unsqueeze(0).expand(
          batch_size, seq_len
      )
      seq_length_expand = (
          input_lengths.clone()
          .detach()
          .to(seq_range_expand.device)
          .unsqueeze(-1)
      )
      mask = seq_range_expand < seq_length_expand
      return mask
  
imports: import os
  import struct
  from pickle import UnpicklingError
  from typing import List, Optional, Tuple, Union
  import torch
  from nemo.core.utils.k2_guard import k2
  from nemo.utils import logging
label_desc: Use image node_id 3 for calling a global function with example usage: make_non_pad_mask(input_lengths, seq_len) and returns: mask