class_docstr: Parallel attention and feedforward with residual discovered by Wang et al + EleutherAI from GPT-J fame.
  
  Args:
      dim (`int`):
          Dimension of features.
      dim_head (`int`):
          Head of fused dimensions.
      heads (`int`):
          Number of heads.
      ff_mult (`int`):
          Multiple number for feedforward.
class_docstr_tok: ["Parallel","attention","and","feedforward","with","residual","discovered","by","Wang","et","al","+","EleutherAI","from","GPT-J","fame",".","Args",":","dim","(","`","int","`",")",":","Dimension","of","features",".","dim_head","(","`","int","`",")",":","Head","of","fused","dimensions",".","heads","(","`","int","`",")",":","Number","of","heads",".","ff_mult","(","`","int","`",")",":","Multiple","number","for","feedforward","."]
code: def get_mask(self, n, device):
      if self.mask is not None and self.mask.shape[-1] >= n:
          return self.mask[:n, :n]
  
      mask = torch.ones((n, n), device=device, dtype=torch.bool).triu(1)
      self.register_buffer("mask", mask, persistent=False)
      return mask
  
file_path: towhee/towhee/models/coca/coca.py
imports: import torch
  from torch import einsum, nn
  import torch.nn.functional
  from einops import rearrange, repeat
  from towhee.models.layers.cross_attention import LayerNorm, Residual, RotaryEmbedding, apply_rotary_pos_emb, CrossAttention
  from towhee.models.layers.activations.swiglu import SwiGLU
label_desc: Use image node_id 2 for calling the ParallelTransformerBlock obj's underlying member method code with example usage: obj.get_mask(n, device) and returns: mask, self