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 attention(self, x: torch.Tensor):
      self.attn_mask = (
          self.attn_mask.to(dtype=x.dtype, device=x.device)
          if self.attn_mask is not None
          else None
      )
      return self.attn(
          x, x, x, need_weights=False, attn_mask=self.attn_mask
      )[0]
  
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 2 for calling the ResidualAttentionBlock obj's underlying member method code with example usage: obj.attention(x) and returns: self