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 __init__(
      self,
      num_q_channels: int,
      num_kv_channels: int,
      num_heads: int,
      dropout: float,
  ):
      super().__init__()
      self.q_norm = nn.LayerNorm(num_q_channels)
      self.kv_norm = nn.LayerNorm(num_kv_channels)
      self.attention = MultiHeadAttention(
          num_q_channels=num_q_channels,
          num_kv_channels=num_kv_channels,
          num_heads=num_heads,
          dropout=dropout,
      )
  
imports: from torch import nn
  from towhee.models.perceiver.multi_head_attention import MultiHeadAttention
label_desc: Use image node_id 1 to create a new CrossAttention object from inherited base classes: nn with example: obj = CrossAttention(num_q_channels, num_kv_channels, num_heads, dropout)