code: def _build_causal_attention_mask(self, bsz, seq_len, dtype):
      mask = torch.empty(
          bsz,
          seq_len,
          seq_len,
          dtype=dtype,
          device=torch.cuda.current_device(),
      )
      mask.fill_(torch.tensor(torch.finfo(dtype).min))
      mask.triu_(1)
      mask = mask.unsqueeze(1)
      return mask
  
file_path: H2O/h2o_flexgen/benchmark/third_party/DeepSpeed/deepspeed/model_implementations/transformers/clip_encoder.py
imports: import torch
label_desc: Use image node_id 2 for calling the DSClipEncoder obj's underlying member method code with example usage: obj._build_causal_attention_mask(bsz, seq_len, dtype) and returns: mask