class_docstr: Description
  -----------
  The attention function. Correspond to :math:`s` in eq.27 the paper.
  
  Parameters
  ----------
  tau : float
      The lower thresholding parameter. Correspond to :math:`\tau` in the paper.
  T : float
      The upper thresholding parameter. Correspond to :math:`T` in the paper.
  p : float
      Correspond to :math:`\rho` in the paper..
  attn_dropout : float
      the dropout rate of attention value. Default: ``0.0``.
  
  Returns
  -------
  torch.Tensor
      The output feature
class_docstr_tok: ["Description","--","--","--","--","--","-","The","attention","function",".","Correspond","to",":","math",":","`","s","`","in","eq.27","the","paper",".","Parameters","--","--","--","--","--","tau",":","float","The","lower","thresholding","parameter",".","Correspond","to",":","math",":","`","\\tau","`","in","the","paper",".","T",":","float","The","upper","thresholding","parameter",".","Correspond","to",":","math",":","`","T","`","in","the","paper",".","p",":","float","Correspond","to",":","math",":","`","\\rho","`","in","the","paper","..","attn_dropout",":","float","the","dropout","rate","of","attention","value",".","Default",":","``","0.0","``",".","Returns","--","--","--","-","torch.Tensor","The","output","feature"]
docstr: Compute graph edge weight. Would be stored in ``graph.edata['w']``
docstr_tok: ["Compute","graph","edge","weight",".","Would","be","stored","in","``","graph.edata","[","'","w","'","]","``"]
code: def reweighting(self, graph):
      """Compute graph edge weight. Would be stored in ``graph.edata['w']``"""
  
      w = graph.edata["w"]
  
      # It is not activation here but to ensure w > 0.
      # w can be < 0 here because of some precision issue in dgl, which causes NaN afterwards.
      w = F.relu(w) + 1e-7
  
      w = tc.pow(w, 1 - 0.5 * self.p)
  
      w[(w < self.tau)] = self.tau
      if self.T > 0:
          w[(w > self.T)] = float("inf")
  
      w = 1 / w
  
      # if not (w == w).all():
      #     raise "nan occured!"
  
      graph.edata["w"] = w + 1e-9
  
imports: import torch
  import torch.nn
  import torch.nn.functional
  from ....None import function
label_desc: Use image node_id 2 for calling the Attention obj's underlying member method code with example usage: obj.reweighting(graph) without return types