code: def sequence_mask(length, max_length=None):
      if max_length is None:
          max_length = length.max()
      x = torch.arange(
          max_length, dtype=length.dtype, device=length.device
      )
      return x.unsqueeze(0) < length.unsqueeze(1)
  
imports: import math
  import numpy
  import torch
  from torch import nn
  from torch.nn import functional
label_desc: Use image node_id 17 for calling a global function with example usage: sequence_mask(length, max_length) and returns: unknown