class_docstr: Multi-Head Attention
      
code: def __init__(
      self,
      dim,
      hidden_dim,
      num_heads=8,
      qkv_bias=False,
      attn_drop=0.0,
      proj_drop=0.0,
  ):
      super().__init__()
      self.hidden_dim = hidden_dim
      self.num_heads = num_heads
      head_dim = hidden_dim // num_heads
      self.head_dim = head_dim
      self.scale = head_dim**-0.5
  
      self.qk = nn.Linear(dim, hidden_dim * 2, bias=qkv_bias)
      self.v = nn.Linear(dim, dim, bias=qkv_bias)
      self.attn_drop = nn.Dropout(attn_drop, inplace=True)
      self.proj = nn.Linear(dim, dim)
      self.proj_drop = nn.Dropout(proj_drop, inplace=True)
  
imports: import math
  import torch
  import torch.nn
  from torch.utils.checkpoint import checkpoint
  from timm.data import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD
  from timm.layers import Mlp, DropPath, trunc_normal_, _assert, to_2tuple
  from ._builder import build_model_with_cfg
  from ._registry import register_model
  from .vision_transformer import resize_pos_embed
label_desc: Use image node_id 1 to create a new Attention object from inherited base classes: nn with example: obj = Attention(dim, hidden_dim, num_heads, qkv_bias, attn_drop, proj_drop)