code: def __init__(
      self,
      emb_size: int,
      num_heads: int,
      att_drop: float,
      proj_drop: float,
  ) -> None:
      super().__init__()
      self.emb_size = emb_size
      self.num_heads = num_heads
      head_size = emb_size // num_heads  # from timm
      self.scale = head_size**-0.5  # from timm
  
      if self.emb_size % self.num_heads:
          raise ValueError(
              f"Size of embedding inside the transformer decoder must be visible by number of heads"
              f"for correct multi-head attention "
              f"Got: {self.emb_size} embedding size and {self.num_heads} numbers of heads"
          )
  
      # fuse the queries, keys and values in one matrix
      self.qkv = nn.Linear(emb_size, emb_size * 3, bias=False)
      self.att_drop = nn.Dropout(att_drop)
      self.projection = nn.Linear(emb_size, emb_size)
      self.projection_drop = nn.Dropout(proj_drop)
  
imports: from typing import Any, Callable, Dict, List, Optional, Tuple
  import torch
  from torch import nn
  from kornia.core import Module, Tensor
label_desc: Use image node_id 1 to create a new MultiHeadAttention object from inherited base classes: Module with example: obj = MultiHeadAttention(emb_size, num_heads, att_drop, proj_drop)