class_docstr: Applies layer normalization over each individual example in a batch
  of features as described in the `"Layer Normalization"
  <https://arxiv.org/abs/1607.06450>`_ paper.
  
  .. math::
      \mathbf{x}^{\prime}_i = \frac{\mathbf{x} -
      \textrm{E}[\mathbf{x}]}{\sqrt{\textrm{Var}[\mathbf{x}] + \epsilon}}
      \odot \gamma + \beta
  
  The mean and standard-deviation are calculated across all nodes and all
  node channels separately for each object in a mini-batch.
  
  Args:
      in_channels (int): Size of each input sample.
      eps (float, optional): A value added to the denominator for numerical
          stability. (default: :obj:`1e-5`)
      affine (bool, optional): If set to :obj:`True`, this module has
          learnable affine parameters :math:`\gamma` and :math:`\beta`.
          (default: :obj:`True`)
      mode (str, optinal): The normalization mode to use for layer
          normalization (:obj:`"graph"` or :obj:`"node"`). If :obj:`"graph"`
          is used, each graph will be considered as an element to be
          normalized. If `"node"` is used, each node will be considered as
          an element to be normalized. (default: :obj:`"graph"`)
class_docstr_tok: ["Applies","layer","normalization","over","each","individual","example","in","a","batch","of","features","as","described","in","the","`","``","Layer","Normalization","''","<","https",":","\/\/arxiv.org\/abs\/1607.06450",">","`","_","paper",".","..","math",":",":","\\mathbf","{","x","}","^","{","\\prime","}","_i","=","\\frac","{","\\mathbf","{","x","}","-","\\textrm","{","E","}","[","\\mathbf","{","x","}","]","}","{","\\sqrt","{","\\textrm","{","Var","}","[","\\mathbf","{","x","}","]","+","\\epsilon","}","}","\\odot","\\gamma","+","\\beta","The","mean","and","standard-deviation","are","calculated","across","all","nodes","and","all","node","channels","separately","for","each","object","in","a","mini-batch",".","Args",":","in_channels","(","int",")",":","Size","of","each","input","sample",".","eps","(","float",",","optional",")",":","A","value","added","to","the","denominator","for","numerical","stability",".","(","default",":",":","obj",":","`","1e-5","`",")","affine","(","bool",",","optional",")",":","If","set","to",":","obj",":","`","True","`",",","this","module","has","learnable","affine","parameters",":","math",":","`","\\gamma","`","and",":","math",":","`","\\beta","`",".","(","default",":",":","obj",":","`","True","`",")","mode","(","str",",","optinal",")",":","The","normalization","mode","to","use","for","layer","normalization","(",":","obj",":","`","``","graph","''","`","or",":","obj",":","`","``","node","''","`",")",".","If",":","obj",":","`","``","graph","''","`","is","used",",","each","graph","will","be","considered","as","an","element","to","be","normalized",".","If","`","``","node","''","`","is","used",",","each","node","will","be","considered","as","an","element","to","be","normalized",".","(","default",":",":","obj",":","`","``","graph","''","`",")"]
code: def __init__(
      self,
      in_channels: int,
      eps: float = 1e-5,
      affine: bool = True,
      mode: str = "graph",
  ):
      super().__init__()
  
      self.in_channels = in_channels
      self.eps = eps
      self.affine = affine
      self.mode = mode
  
      if affine:
          self.weight = Parameter(torch.empty(in_channels))
          self.bias = Parameter(torch.empty(in_channels))
      else:
          self.register_parameter("weight", None)
          self.register_parameter("bias", None)
  
      self.reset_parameters()
  
file_path: pytorch_geometric/torch_geometric/nn/norm/layer_norm.py
imports: from typing import List, Optional, Union
  import torch
  import torch.nn.functional
  from torch import Tensor
  from torch.nn import Parameter
  from torch_geometric.nn.inits import ones, zeros
  from torch_geometric.typing import OptTensor
  from torch_geometric.utils import degree, scatter
label_desc: Use image node_id 1 to create a new LayerNorm object from inherited base classes: torch.nn with example: obj = LayerNorm(in_channels, eps, affine, mode)