class_docstr: Applies batch normalization over a batch of heterogeneous features as
  described in the `"Batch Normalization: Accelerating Deep Network Training
  by Reducing Internal Covariate Shift" <https://arxiv.org/abs/1502.03167>`_
  paper.
  Compared to :class:`BatchNorm`, :class:`HeteroBatchNorm` applies
  normalization individually for each node or edge type.
  
  Args:
      in_channels (int): Size of each input sample.
      num_types (int): The number of types.
      eps (float, optional): A value added to the denominator for numerical
          stability. (default: :obj:`1e-5`)
      momentum (float, optional): The value used for the running mean and
          running variance computation. (default: :obj:`0.1`)
      affine (bool, optional): If set to :obj:`True`, this module has
          learnable affine parameters :math:`\gamma` and :math:`\beta`.
          (default: :obj:`True`)
      track_running_stats (bool, optional): If set to :obj:`True`, this
          module tracks the running mean and variance, and when set to
          :obj:`False`, this module does not track such statistics and always
          uses batch statistics in both training and eval modes.
          (default: :obj:`True`)
class_docstr_tok: ["Applies","batch","normalization","over","a","batch","of","heterogeneous","features","as","described","in","the","`","``","Batch","Normalization",":","Accelerating","Deep","Network","Training","by","Reducing","Internal","Covariate","Shift","''","<","https",":","\/\/arxiv.org\/abs\/1502.03167",">","`","_","paper",".","Compared","to",":","class",":","`","BatchNorm","`",",",":","class",":","`","HeteroBatchNorm","`","applies","normalization","individually","for","each","node","or","edge","type",".","Args",":","in_channels","(","int",")",":","Size","of","each","input","sample",".","num_types","(","int",")",":","The","number","of","types",".","eps","(","float",",","optional",")",":","A","value","added","to","the","denominator","for","numerical","stability",".","(","default",":",":","obj",":","`","1e-5","`",")","momentum","(","float",",","optional",")",":","The","value","used","for","the","running","mean","and","running","variance","computation",".","(","default",":",":","obj",":","`","0.1","`",")","affine","(","bool",",","optional",")",":","If","set","to",":","obj",":","`","True","`",",","this","module","has","learnable","affine","parameters",":","math",":","`","\\gamma","`","and",":","math",":","`","\\beta","`",".","(","default",":",":","obj",":","`","True","`",")","track_running_stats","(","bool",",","optional",")",":","If","set","to",":","obj",":","`","True","`",",","this","module","tracks","the","running","mean","and","variance",",","and","when","set","to",":","obj",":","`","False","`",",","this","module","does","not","track","such","statistics","and","always","uses","batch","statistics","in","both","training","and","eval","modes",".","(","default",":",":","obj",":","`","True","`",")"]
code: def __init__(
      self,
      in_channels: int,
      num_types: int,
      eps: float = 1e-5,
      momentum: Optional[float] = 0.1,
      affine: bool = True,
      track_running_stats: bool = True,
  ):
      super().__init__()
  
      self.in_channels = in_channels
      self.num_types = num_types
      self.eps = eps
      self.momentum = momentum
      self.affine = affine
      self.track_running_stats = track_running_stats
  
      if self.affine:
          self.weight = Parameter(torch.empty(num_types, in_channels))
          self.bias = Parameter(torch.empty(num_types, in_channels))
      else:
          self.register_parameter("weight", None)
          self.register_parameter("bias", None)
  
      if self.track_running_stats:
          self.register_buffer(
              "running_mean", torch.empty(num_types, in_channels)
          )
          self.register_buffer(
              "running_var", torch.empty(num_types, in_channels)
          )
          self.register_buffer("num_batches_tracked", torch.tensor(0))
      else:
          self.register_buffer("running_mean", None)
          self.register_buffer("running_var", None)
          self.register_buffer("num_batches_tracked", None)
  
      self.mean_var = FusedAggregation(["mean", "var"])
  
      self.reset_parameters()
  
file_path: pytorch_geometric/torch_geometric/nn/norm/batch_norm.py
imports: from typing import Optional
  import torch
  from torch import Tensor
  from torch.nn import Parameter
  from torch_geometric.nn.aggr.fused import FusedAggregation
label_desc: Use image node_id 1 to create a new HeteroBatchNorm object from inherited base classes: torch.nn with example: obj = HeteroBatchNorm(in_channels, num_types, eps, momentum, affine, track_running_stats)