class_docstr: Dense Multi-Head Attention Module with Graph Attention Bias.
  
  Compute attention between nodes with attention bias obtained from graph
  structures, as introduced in `Do Transformers Really Perform Bad for
  Graph Representation? <https://arxiv.org/pdf/2106.05234>`__
  
  .. math::
  
      \text{Attn}=\text{softmax}(\dfrac{QK^T}{\sqrt{d}} \circ b)
  
  :math:`Q` and :math:`K` are feature representations of nodes. :math:`d`
  is the corresponding :attr:`feat_size`. :math:`b` is attention bias, which
  can be additive or multiplicative according to the operator :math:`\circ`.
  
  Parameters
  ----------
  feat_size : int
      Feature size.
  num_heads : int
      Number of attention heads, by which :attr:`feat_size` is divisible.
  bias : bool, optional
      If True, it uses bias for linear projection. Default: True.
  attn_bias_type : str, optional
      The type of attention bias used for modifying attention. Selected from
      'add' or 'mul'. Default: 'add'.
  
      * 'add' is for additive attention bias.
      * 'mul' is for multiplicative attention bias.
  attn_drop : float, optional
      Dropout probability on attention weights. Defalt: 0.1.
  
  Examples
  --------
  >>> import torch as th
  >>> from dgl.nn import BiasedMHA
  
  >>> ndata = th.rand(16, 100, 512)
  >>> bias = th.rand(16, 100, 100, 8)
  >>> net = BiasedMHA(feat_size=512, num_heads=8)
  >>> out = net(ndata, bias)
docstr: Initialize parameters of projection matrices, the same settings as in
  the original implementation of the paper.
docstr_tok: ["Initialize","parameters","of","projection","matrices",",","the","same","settings","as","in","the","original","implementation","of","the","paper","."]
code: def reset_parameters(self):
      """
      Initialize parameters of projection matrices, the same settings as in
      the original implementation of the paper.
      """
      nn.init.xavier_uniform_(self.q_proj.weight, gain=2**-0.5)
      nn.init.xavier_uniform_(self.k_proj.weight, gain=2**-0.5)
      nn.init.xavier_uniform_(self.v_proj.weight, gain=2**-0.5)
  
      nn.init.xavier_uniform_(self.out_proj.weight)
      if self.out_proj.bias is not None:
          nn.init.constant_(self.out_proj.bias, 0.0)
  
file_path: dgl/python/dgl/nn/pytorch/gt/biased_mha.py
imports: import torch
  import torch.nn
  import torch.nn.functional
label_desc: Use image node_id 2 for calling the BiasedMHA obj's underlying member method code with example usage: obj.reset_parameters() without return types