class_docstr: This module normalizes positive scalar edge weights on a graph
  following the form in `GCN <https://arxiv.org/abs/1609.02907>`__.
  
  Mathematically, setting ``norm='both'`` yields the following normalization term:
  
  .. math::
    c_{ji} = (\sqrt{\sum_{k\in\mathcal{N}(j)}e_{jk}}\sqrt{\sum_{k\in\mathcal{N}(i)}e_{ki}})
  
  And, setting ``norm='right'`` yields the following normalization term:
  
  .. math::
    c_{ji} = (\sum_{k\in\mathcal{N}(i)}e_{ki})
  
  where :math:`e_{ji}` is the scalar weight on the edge from node :math:`j` to node :math:`i`.
  
  The module returns the normalized weight :math:`e_{ji} / c_{ji}`.
  
  Parameters
  ----------
  norm : str, optional
      The normalizer as specified above. Default is `'both'`.
  eps : float, optional
      A small offset value in the denominator. Default is 0.
  
  Examples
  --------
  >>> import dgl
  >>> import numpy as np
  >>> import torch as th
  >>> from dgl.nn import EdgeWeightNorm, GraphConv
  
  >>> g = dgl.graph(([0,1,2,3,2,5], [1,2,3,4,0,3]))
  >>> g = dgl.add_self_loop(g)
  >>> feat = th.ones(6, 10)
  >>> edge_weight = th.tensor([0.5, 0.6, 0.4, 0.7, 0.9, 0.1, 1, 1, 1, 1, 1, 1])
  >>> norm = EdgeWeightNorm(norm='both')
  >>> norm_edge_weight = norm(g, edge_weight)
  >>> conv = GraphConv(10, 2, norm='none', weight=True, bias=True)
  >>> res = conv(g, feat, edge_weight=norm_edge_weight)
  >>> print(res)
  tensor([[-1.1849, -0.7525],
          [-1.3514, -0.8582],
          [-1.2384, -0.7865],
          [-1.9949, -1.2669],
          [-1.3658, -0.8674],
          [-0.8323, -0.5286]], grad_fn=<AddBackward0>)
class_docstr_tok: ["This","module","normalizes","positive","scalar","edge","weights","on","a","graph","following","the","form","in","`","GCN","<","https",":","\/\/arxiv.org\/abs\/1609.02907",">","`","__",".","Mathematically",",","setting","``","norm='both","'","``","yields","the","following","normalization","term",":","..","math",":",":","c_","{","ji","}","=","(","\\sqrt","{","\\sum_","{","k\\in\\mathcal","{","N","}","(","j",")","}","e_","{","jk","}","}","\\sqrt","{","\\sum_","{","k\\in\\mathcal","{","N","}","(","i",")","}","e_","{","ki","}","}",")","And",",","setting","``","norm='right","'","``","yields","the","following","normalization","term",":","..","math",":",":","c_","{","ji","}","=","(","\\sum_","{","k\\in\\mathcal","{","N","}","(","i",")","}","e_","{","ki","}",")","where",":","math",":","`","e_","{","ji","}","`","is","the","scalar","weight","on","the","edge","from","node",":","math",":","`","j","`","to","node",":","math",":","`","i","`",".","The","module","returns","the","normalized","weight",":","math",":","`","e_","{","ji","}","\/","c_","{","ji","}","`",".","Parameters","--","--","--","--","--","norm",":","str",",","optional","The","normalizer","as","specified","above",".","Default","is","`","'both","'","`",".","eps",":","float",",","optional","A","small","offset","value","in","the","denominator",".","Default","is","0",".","Examples","--","--","--","--",">",">",">","import","dgl",">",">",">","import","numpy","as","np",">",">",">","import","torch","as","th",">",">",">","from","dgl.nn","import","EdgeWeightNorm",",","GraphConv",">",">",">","g","=","dgl.graph","(","(","[","0,1,2,3,2,5","]",",","[","1,2,3,4,0,3","]",")",")",">",">",">","g","=","dgl.add_self_loop","(","g",")",">",">",">","feat","=","th.ones","(","6",",","10",")",">",">",">","edge_weight","=","th.tensor","(","[","0.5",",","0.6",",","0.4",",","0.7",",","0.9",",","0.1",",","1",",","1",",","1",",","1",",","1",",","1","]",")",">",">",">","norm","=","EdgeWeightNorm","(","norm='both","'",")",">",">",">","norm_edge_weight","=","norm","(","g",",","edge_weight",")",">",">",">","conv","=","GraphConv","(","10",",","2",",","norm='none","'",",","weight=True",",","bias=True",")",">",">",">","res","=","conv","(","g",",","feat",",","edge_weight=norm_edge_weight",")",">",">",">","print","(","res",")","tensor","(","[","[","-1.1849",",","-0.7525","]",",","[","-1.3514",",","-0.8582","]",",","[","-1.2384",",","-0.7865","]",",","[","-1.9949",",","-1.2669","]",",","[","-1.3658",",","-0.8674","]",",","[","-0.8323",",","-0.5286","]","]",",","grad_fn=","<","AddBackward0",">",")"]
code: def __init__(self, norm="both", eps=0.0):
      super(EdgeWeightNorm, self).__init__()
      self._norm = norm
      self._eps = eps
  
file_path: dgl/python/dgl/nn/pytorch/conv/graphconv.py
imports: import torch
  from torch import nn
  from torch.nn import init
  from ....None import function
  from ....base import DGLError
  from ....convert import block_to_graph
  from ....heterograph import DGLBlock
  from ....transforms import reverse
  from ....utils import expand_as_pair
label_desc: Use image node_id 1 to create a new EdgeWeightNorm object from inherited base classes: nn with example: obj = EdgeWeightNorm(norm, eps)