class_docstr: Allows the model to jointly attend to information
  from different representation subspaces.
  See reference: Attention Is All You Need
  
  .. math::
      text{MultiHead}(Q, K, V) = text{Concat}(head_1,dots,head_h)W^O
      text{where} head_i = text{Attention}(QW_i^Q, KW_i^K, VW_i^V)
  
  Args:
      embed_dim: total dimension of the model.
      num_heads: parallel attention heads.
      dropout: a Dropout layer on attn_output_weights. Default: 0.0.
      bias: add bias as module parameter. Default: True.
      add_bias_kv: add bias to the key and value sequences at dim=0.
      add_zero_attn: add a new batch of zeros to the key and
                     value sequences at dim=1.
      kdim: total number of features in key. Default: None.
      vdim: total number of features in value. Default: None.
  
      Note: if kdim and vdim are None, they will be set to embed_dim such that
      query, key, and value have the same number of features.
  
  Examples::
  
      >>> multihead_attn = nn.MultiheadAttention(embed_dim, num_heads)
      >>> attn_output, attn_output_weights = multihead_attn(query, key, value)
class_docstr_tok: ["Allows","the","model","to","jointly","attend","to","information","from","different","representation","subspaces",".","See","reference",":","Attention","Is","All","You","Need","..","math",":",":","text","{","MultiHead","}","(","Q",",","K",",","V",")","=","text","{","Concat","}","(","head_1",",","dots",",","head_h",")","W^O","text","{","where","}","head_i","=","text","{","Attention","}","(","QW_i^Q",",","KW_i^K",",","VW_i^V",")","Args",":","embed_dim",":","total","dimension","of","the","model",".","num_heads",":","parallel","attention","heads",".","dropout",":","a","Dropout","layer","on","attn_output_weights",".","Default",":","0.0.","bias",":","add","bias","as","module","parameter",".","Default",":","True",".","add_bias_kv",":","add","bias","to","the","key","and","value","sequences","at","dim=0",".","add_zero_attn",":","add","a","new","batch","of","zeros","to","the","key","and","value","sequences","at","dim=1",".","kdim",":","total","number","of","features","in","key",".","Default",":","None",".","vdim",":","total","number","of","features","in","value",".","Default",":","None",".","Note",":","if","kdim","and","vdim","are","None",",","they","will","be","set","to","embed_dim","such","that","query",",","key",",","and","value","have","the","same","number","of","features",".","Examples",":",":",">",">",">","multihead_attn","=","nn.MultiheadAttention","(","embed_dim",",","num_heads",")",">",">",">","attn_output",",","attn_output_weights","=","multihead_attn","(","query",",","key",",","value",")"]
code: def _reset_parameters(self):
      if self._qkv_same_embed_dim:
          xavier_uniform_(self.in_proj_weight)
          xavier_uniform_(self.fixed_k)
          xavier_uniform_(self.fixed_q)
      else:
          xavier_uniform_(self.q_proj_weight)
          xavier_uniform_(self.k_proj_weight)
          xavier_uniform_(self.v_proj_weight)
  
      if self.in_proj_bias is not None:
          constant_(self.in_proj_bias, 0.0)
          constant_(self.out_proj.bias, 0.0)
      if self.bias_k is not None:
          xavier_normal_(self.bias_k)
      if self.bias_v is not None:
          xavier_normal_(self.bias_v)
  
imports: import math
  from typing import Optional, Tuple
  import torch
  import torch.nn.functional
  from torch.nn import Module, init
  from torch.nn.functional import dropout, linear, softmax
  from torch.nn.init import constant_, xavier_normal_, xavier_uniform_
  from torch.nn.modules.dropout import Dropout
  from torch.nn.modules.normalization import LayerNorm
  from torch.nn.parameter import Parameter
label_desc: Use image node_id 2 for calling the MultiheadAttention obj's underlying member method code with example usage: obj._reset_parameters() without return types