class_docstr: ClassAttention
class_docstr_tok: ["ClassAttention"]
code: def __init__(self, dim, num_heads):
      super().__init__()
      self.num_heads = num_heads
      head_dim = dim // num_heads
      self.head_dim = head_dim
      self.scale = head_dim**-0.5
      self.kv = nn.Linear(dim, dim * 2)
      self.q = nn.Linear(dim, dim)
      self.proj = nn.Linear(dim, dim)
      self.apply(init_vit_weights)
  
imports: import torch
  from torch import nn
  from timm.models.layers import DropPath
  import numpy
  from towhee.models.wave_vit.wave_vit_utils import DWT2D, IDWT2D
  from towhee.models.utils.init_vit_weights import init_vit_weights
  from towhee.models.layers.mlp import Mlp
label_desc: Use image node_id 1 to create a new ClassAttention object from inherited base classes: nn with example: obj = ClassAttention(dim, num_heads)