docstr: Args:
      dim:
      num_heads:
      qkv_bias:
      qkv_fused:
      attn_drop:
      proj_drop:
      attn_head_dim:
      norm_layer:
code: def __init__(
      self,
      dim: int,
      num_heads: int = 8,
      qkv_bias: bool = True,
      qkv_fused: bool = True,
      attn_drop: float = 0.0,
      proj_drop: float = 0.0,
      attn_head_dim: Optional[int] = None,
      norm_layer: Optional[Callable] = None,
  ):
      """
  
      Args:
          dim:
          num_heads:
          qkv_bias:
          qkv_fused:
          attn_drop:
          proj_drop:
          attn_head_dim:
          norm_layer:
      """
      super().__init__()
      self.num_heads = num_heads
      head_dim = dim // num_heads
      if attn_head_dim is not None:
          head_dim = attn_head_dim
      all_head_dim = head_dim * self.num_heads
      self.scale = head_dim**-0.5
      self.fused_attn = use_fused_attn()
  
      if qkv_fused:
          self.qkv = nn.Linear(dim, all_head_dim * 3, bias=False)
          self.q_proj = self.k_proj = self.v_proj = None
          if qkv_bias:
              self.q_bias = nn.Parameter(torch.zeros(all_head_dim))
              self.register_buffer(
                  "k_bias", torch.zeros(all_head_dim), persistent=False
              )
              self.v_bias = nn.Parameter(torch.zeros(all_head_dim))
          else:
              self.q_bias = self.k_bias = self.v_bias = None
      else:
          self.q_proj = nn.Linear(dim, all_head_dim, bias=qkv_bias)
          self.k_proj = nn.Linear(dim, all_head_dim, bias=False)
          self.v_proj = nn.Linear(dim, all_head_dim, bias=qkv_bias)
          self.qkv = None
          self.q_bias = self.k_bias = self.v_bias = None
  
      self.attn_drop = nn.Dropout(attn_drop)
      self.norm = (
          norm_layer(all_head_dim)
          if norm_layer is not None
          else nn.Identity()
      )
      self.proj = nn.Linear(all_head_dim, dim)
      self.proj_drop = nn.Dropout(proj_drop)
  
imports: import math
  from typing import Callable, Optional, Tuple, Union
  import torch
  import torch.nn
  import torch.nn.functional
  from torch.utils.checkpoint import checkpoint
  from timm.data import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD, OPENAI_CLIP_MEAN, OPENAI_CLIP_STD
  from timm.layers import PatchEmbed, Mlp, GluMlp, SwiGLU, LayerNorm, DropPath, PatchDropout, RotaryEmbeddingCat, apply_rot_embed_cat, apply_keep_indices_nlc, trunc_normal_, resample_patch_embed, resample_abs_pos_embed, to_2tuple, use_fused_attn
  from ._builder import build_model_with_cfg
  from ._registry import generate_default_cfgs, register_model
label_desc: Use image node_id 1 to create a new EvaAttention object from inherited base classes: nn with example: obj = EvaAttention(dim, num_heads, qkv_bias, qkv_fused, attn_drop, proj_drop, attn_head_dim, norm_layer)