class_docstr: Modified cross attention for BridgeFormer.
  
  Args:
      dim (`int`):
          Dimension of features.
      num_heads (`int`):
          Number of heads.
      qkv_bias (`bool`):
          If add bias to qkv.
      qk_scale (`float`):
          Number to scale qk.
      attn_drop (`float`):
          Drop rate of attention layer.
      proj_drop (`float`):
          Drop rate of projection layer.
class_docstr_tok: ["Modified","cross","attention","for","BridgeFormer",".","Args",":","dim","(","`","int","`",")",":","Dimension","of","features",".","num_heads","(","`","int","`",")",":","Number","of","heads",".","qkv_bias","(","`","bool","`",")",":","If","add","bias","to","qkv",".","qk_scale","(","`","float","`",")",":","Number","to","scale","qk",".","attn_drop","(","`","float","`",")",":","Drop","rate","of","attention","layer",".","proj_drop","(","`","float","`",")",":","Drop","rate","of","projection","layer","."]
code: def __init__(
      self,
      dim,
      num_heads=8,
      qkv_bias=False,
      qk_scale=None,
      attn_drop=0.0,
      proj_drop=0.0,
  ):
      super().__init__()
      self.num_heads = num_heads
      head_dim = dim // num_heads
      # NOTE scale factor was wrong in my original version, can set manually to be compat with prev weights
      self.scale = qk_scale or head_dim**-0.5
      self.q_question = nn.Linear(dim, dim * 1, bias=qkv_bias)
  
      self.kv_video = nn.Linear(dim, dim * 2, bias=qkv_bias)
      self.proj = nn.Linear(dim, dim)
      self.attn_drop = nn.Dropout(attn_drop)
      self.proj_drop = nn.Dropout(proj_drop)
  
imports: from collections import OrderedDict
  from functools import partial
  import torch
  from einops import rearrange, repeat
  from timm.models.layers import DropPath, trunc_normal_
  from torch import einsum, nn
  from towhee.models.layers.mlp import Mlp
  from towhee.models.layers.patch_embed2d import PatchEmbed2D
  from towhee.models.utils.init_vit_weights import init_vit_weights
  from towhee.models.frozen_in_time.frozen_video_transformer import attn
label_desc: Use image node_id 1 to create a new CrossAttention object from inherited base classes: nn with example: obj = CrossAttention(dim, num_heads, qkv_bias, qk_scale, attn_drop, proj_drop)