code: def get_lookahead_mask(padded_input):
      """Creates a binary mask for each sequence which maskes future frames.
      Arguments
      ---------
      padded_input: torch.Tensor
          Padded input tensor.
      Example
      -------
      >>> a = torch.LongTensor([[1,1,0], [2,3,0], [4,5,0]])
      >>> get_lookahead_mask(a)
      tensor([[0., -inf, -inf],
              [0., 0., -inf],
              [0., 0., 0.]])
      """
      seq_len = padded_input.shape[1]
      mask = (
          torch.triu(
              torch.ones((seq_len, seq_len), device=padded_input.device)
          )
          == 1
      ).transpose(0, 1)
      mask = (
          mask.float()
          .masked_fill(mask == 0, float("-inf"))
          .masked_fill(mask == 1, float(0.0))
      )
      return mask.detach().to(padded_input.device)
  
imports: import math
  import torch
  import torch.nn
  import speechbrain
  from typing import Optional
  import numpy
  from .Conformer import ConformerEncoder
  from .Branchformer import BranchformerEncoder
  from speechbrain.nnet.activations import Swish
  from speechbrain.nnet.attention import RelPosEncXL
  from speechbrain.nnet.CNN import Conv1d
label_desc: Use image node_id 2 for calling a global function with example usage: get_lookahead_mask(padded_input) and returns: mask