class_docstr: Multi-headed attention.
  
  See "Attention Is All You Need" for more details.
class_docstr_tok: ["Multi-headed","attention",".","See","``","Attention","Is","All","You","Need","''","for","more","details","."]
code: def reset_parameters(self):
      if self.qkv_same_dim:
          # Empirically observed the convergence to be much better with
          # the scaled initialization
          nn.init.xavier_uniform_(
              self.k_proj.weight, gain=1 / math.sqrt(2)
          )
          nn.init.xavier_uniform_(
              self.v_proj.weight, gain=1 / math.sqrt(2)
          )
          nn.init.xavier_uniform_(
              self.q_proj.weight, gain=1 / math.sqrt(2)
          )
      else:
          nn.init.xavier_uniform_(self.k_proj.weight)
          nn.init.xavier_uniform_(self.v_proj.weight)
          nn.init.xavier_uniform_(self.q_proj.weight)
  
      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)
  
imports: import math
  from typing import Iterable, Iterator, List, Optional, Tuple, Union
  import torch
  import torch.nn
  from torch.nn import BCEWithLogitsLoss, CrossEntropyLoss, MSELoss
  from ...activations import ACT2FN
  from ...modeling_outputs import BaseModelOutputWithNoAttention, SequenceClassifierOutput
  from ...modeling_utils import PreTrainedModel
  from ...utils import logging
  from .configuration_graphormer import GraphormerConfig
label_desc: Use image node_id 2 for calling the GraphormerMultiheadAttention obj's underlying member method code with example usage: obj.reset_parameters() without return types