class_docstr: Multihead Self Attention module
  
  Args:
      embed_dim (int): Total dimension of the model.
      num_heads (int): The number of heads.
      dropout (float, optional):
          Dropout probability on attn_output_weights. Default: ``0.0``
class_docstr_tok: ["Multihead","Self","Attention","module","Args",":","embed_dim","(","int",")",":","Total","dimension","of","the","model",".","num_heads","(","int",")",":","The","number","of","heads",".","dropout","(","float",",","optional",")",":","Dropout","probability","on","attn_output_weights",".","Default",":","``","0.0","``"]
code: def __init__(
      self,
      embed_dim: int,
      num_heads: int,
      dropout: float = 0.0,
  ):
      super().__init__()
      head_dim = embed_dim // num_heads
      if head_dim * num_heads != embed_dim:
          raise ValueError(
              f"`embed_dim ({embed_dim})` is not divisible by `num_heads ({num_heads})`"
          )
  
      self.embed_dim = embed_dim
      self.num_heads = num_heads
      self.dropout = dropout
      self.head_dim = head_dim
  
      self.scaling = self.head_dim**-0.5
  
      self.k_proj = nn.Linear(embed_dim, embed_dim, bias=True)
      self.v_proj = nn.Linear(embed_dim, embed_dim, bias=True)
      self.q_proj = nn.Linear(embed_dim, embed_dim, bias=True)
      self.out_proj = nn.Linear(embed_dim, embed_dim, bias=True)
  
imports: import logging
  from typing import List, Optional, Tuple
  import torch
  from torch import nn, Tensor
  from torch.nn import Module, Parameter
  from .wavlm_attention import WavLMSelfAttention
label_desc: Use image node_id 1 to create a new SelfAttention object from inherited base classes: Module with example: obj = SelfAttention(embed_dim, num_heads, dropout)