class_docstr: Cross attention for Perceiver https://arxiv.org/pdf/2103.03206.pdf.
  Args:
      num_q_channels (`int`):
          Number of q channels.
      num_kv_channels (`int`):
          Number of k or v channels. k has the same channels as v.
      num_heads (`int`):
          Number of parallel attention heads.
      dropout (`nn.Module`):
          Dropout probability.
class_docstr_tok: ["Cross","attention","for","Perceiver","https",":","\/\/arxiv.org\/pdf\/2103.03206.pdf",".","Args",":","num_q_channels","(","`","int","`",")",":","Number","of","q","channels",".","num_kv_channels","(","`","int","`",")",":","Number","of","k","or","v","channels",".","k","has","the","same","channels","as","v.","num_heads","(","`","int","`",")",":","Number","of","parallel","attention","heads",".","dropout","(","`","nn.Module","`",")",":","Dropout","probability","."]
code: def forward(self, x_q, x_kv, pad_mask=None, attn_mask=None):
      x_q = self.q_norm(x_q)
      x_kv = self.kv_norm(x_kv)
      return self.attention(
          x_q, x_kv, pad_mask=pad_mask, attn_mask=attn_mask
      )
  
imports: from torch import nn
  from towhee.models.perceiver.multi_head_attention import MultiHeadAttention
label_desc: Use image node_id 2 for calling the CrossAttention obj's underlying member method code with example usage: obj.forward(x_q, x_kv, pad_mask, attn_mask) and returns: self