code: def _get_causal_mask(seq_length, device):
      # generate a lower triangular mask
      mask = torch.zeros(seq_length, seq_length, device=device)
      for i in range(seq_length):
          for j in range(i + 1):
              mask[i, j] = 1.0
      return 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 2 for calling a global function with example usage: _get_causal_mask(seq_length, device) and returns: mask