class_docstr: Residual Attention Block
  
  Args:
      - d_model (`int`):
          Dimension of features.
      - n_head (`int`):
          Number of heads for multi-head attention.
      - attn_mask (`torch.Tensor`):
          Attention mask.
class_docstr_tok: ["Residual","Attention","Block","Args",":","-","d_model","(","`","int","`",")",":","Dimension","of","features",".","-","n_head","(","`","int","`",")",":","Number","of","heads","for","multi-head","attention",".","-","attn_mask","(","`","torch.Tensor","`",")",":","Attention","mask","."]
code: def __init__(
      self, d_model: int, n_head: int, attn_mask: torch.Tensor = None
  ):
      super().__init__()
  
      self.attn = nn.MultiheadAttention(d_model, n_head)
      self.ln_1 = LayerNorm(d_model)
      self.mlp = nn.Sequential(
          OrderedDict(
              [
                  ("c_fc", nn.Linear(d_model, d_model * 4)),
                  ("gelu", QuickGELU()),
                  ("c_proj", nn.Linear(d_model * 4, d_model)),
              ]
          )
      )
      self.ln_2 = LayerNorm(d_model)
      self.attn_mask = attn_mask
  
imports: import torch
  from torch import nn
  from collections import OrderedDict
  from towhee.models.utils.weight_init import trunc_normal_
  from towhee.models.utils.init_vit_weights import init_vit_weights
label_desc: Use image node_id 1 to create a new ResidualAttentionBlock object from inherited base classes: nn with example: obj = ResidualAttentionBlock(d_model, n_head, attn_mask)