class_docstr: Bidirectional fusion Multi-Head Attention layer.
  
  Args:
      v_dim (int): The dimension of the vision input.
      l_dim (int): The dimension of the language input.
      embed_dim (int): The embedding dimension for the attention operation.
      num_heads (int): The number of attention heads.
      dropout (float, optional): The dropout probability. Defaults to 0.1.
class_docstr_tok: ["Bidirectional","fusion","Multi-Head","Attention","layer",".","Args",":","v_dim","(","int",")",":","The","dimension","of","the","vision","input",".","l_dim","(","int",")",":","The","dimension","of","the","language","input",".","embed_dim","(","int",")",":","The","embedding","dimension","for","the","attention","operation",".","num_heads","(","int",")",":","The","number","of","attention","heads",".","dropout","(","float",",","optional",")",":","The","dropout","probability",".","Defaults","to","0.1","."]
code: def __init__(
      self,
      v_dim: int,
      l_dim: int,
      embed_dim: int,
      num_heads: int,
      dropout: float = 0.1,
  ):
      super(BiMultiHeadAttention, self).__init__()
  
      self.embed_dim = embed_dim
      self.num_heads = num_heads
      self.head_dim = embed_dim // num_heads
      self.v_dim = v_dim
      self.l_dim = l_dim
  
      assert self.head_dim * self.num_heads == self.embed_dim, (
          "embed_dim must be divisible by num_heads "
          f"(got `embed_dim`: {self.embed_dim} "
          f"and `num_heads`: {self.num_heads})."
      )
      self.scale = self.head_dim ** (-0.5)
      self.dropout = dropout
  
      self.v_proj = nn.Linear(self.v_dim, self.embed_dim)
      self.l_proj = nn.Linear(self.l_dim, self.embed_dim)
      self.values_v_proj = nn.Linear(self.v_dim, self.embed_dim)
      self.values_l_proj = nn.Linear(self.l_dim, self.embed_dim)
  
      self.out_v_proj = nn.Linear(self.embed_dim, self.v_dim)
      self.out_l_proj = nn.Linear(self.embed_dim, self.l_dim)
  
      self.stable_softmax_2d = False
      self.clamp_min_for_underflow = True
      self.clamp_max_for_overflow = True
  
      self._reset_parameters()
  
imports: import math
  from typing import Dict, Optional, Tuple
  import torch
  import torch.nn
  import torch.nn.functional
  import torch.utils.checkpoint
  from mmcv.cnn.bricks import DropPath
  from torch import Tensor
label_desc: Use image node_id 1 to create a new BiMultiHeadAttention object from inherited base classes: nn with example: obj = BiMultiHeadAttention(v_dim, l_dim, embed_dim, num_heads, dropout)