class_docstr: This class is implements the complex-valued batch-normalization
  as introduced by "Deep Complex Networks", Trabelsi C. et al.
  
  Arguments
  ---------
  input_shape : tuple
      Expected shape of the input.
  input_size : int
      Expected size of the input.
  dim : int, optional
      It defines the axis that should be normalized. It usually correspond to
      the channel dimension (default -1).
  eps : float, optional
      Term used to stabilize operation (default 1e-4).
  momentum : float, optional
      It defines the momentum as for the real-valued batch-normalization
      (default 0.1).
  scale : bool, optional,
      It defines if scaling should be used or not. It is
      equivalent to the real-valued batchnormalization scaling (default True).
  center : bool, optional
      It defines if centering should be used or not. It is
      equivalent to the real-valued batchnormalization centering
      (default True).
  track_running_stats : bool, optional
      Equivalent to the real-valued batchnormalization parameter.
      When True, stats are tracked. When False, solely statistics computed
      over the batch are used (default True).
  
  Example
  -------
  >>> inp_tensor = torch.rand([10, 16, 30])
  >>> CBN = CBatchNorm(input_shape=inp_tensor.shape)
  >>> out_tensor = CBN(inp_tensor)
  >>> out_tensor.shape
  torch.Size([10, 16, 30])
class_docstr_tok: ["This","class","is","implements","the","complex-valued","batch-normalization","as","introduced","by","``","Deep","Complex","Networks","''",",","Trabelsi","C.","et","al",".","Arguments","--","--","--","--","-","input_shape",":","tuple","Expected","shape","of","the","input",".","input_size",":","int","Expected","size","of","the","input",".","dim",":","int",",","optional","It","defines","the","axis","that","should","be","normalized",".","It","usually","correspond","to","the","channel","dimension","(","default","-1",")",".","eps",":","float",",","optional","Term","used","to","stabilize","operation","(","default","1e-4",")",".","momentum",":","float",",","optional","It","defines","the","momentum","as","for","the","real-valued","batch-normalization","(","default","0.1",")",".","scale",":","bool",",","optional",",","It","defines","if","scaling","should","be","used","or","not",".","It","is","equivalent","to","the","real-valued","batchnormalization","scaling","(","default","True",")",".","center",":","bool",",","optional","It","defines","if","centering","should","be","used","or","not",".","It","is","equivalent","to","the","real-valued","batchnormalization","centering","(","default","True",")",".","track_running_stats",":","bool",",","optional","Equivalent","to","the","real-valued","batchnormalization","parameter",".","When","True",",","stats","are","tracked",".","When","False",",","solely","statistics","computed","over","the","batch","are","used","(","default","True",")",".","Example","--","--","--","-",">",">",">","inp_tensor","=","torch.rand","(","[","10",",","16",",","30","]",")",">",">",">","CBN","=","CBatchNorm","(","input_shape=inp_tensor.shape",")",">",">",">","out_tensor","=","CBN","(","inp_tensor",")",">",">",">","out_tensor.shape","torch.Size","(","[","10",",","16",",","30","]",")"]
code: def __init__(
      self,
      input_shape=None,
      input_size=None,
      dim=-1,
      eps=1e-4,
      momentum=0.1,
      scale=True,
      center=True,
      track_running_stats=True,
  ):
      super().__init__()
  
      self.dim = dim
      self.eps = eps
      self.momentum = momentum
      self.scale = scale
      self.center = center
      self.track_running_stats = track_running_stats
  
      if input_size is None:
          self.num_complex_features = self._check_input(input_shape)
      else:
          self.num_complex_features = input_size // 2
  
      if self.scale:
          self.gamma_rr = Parameter(
              torch.empty(self.num_complex_features)
          )
          self.gamma_ii = Parameter(
              torch.empty(self.num_complex_features)
          )
          self.gamma_ri = Parameter(
              torch.empty(self.num_complex_features)
          )
      else:
          self.register_parameter("gamma_rr", None)
          self.register_parameter("gamma_ii", None)
          self.register_parameter("gamma_ri", None)
  
      if self.center:
          self.beta = Parameter(
              torch.empty(self.num_complex_features * 2)
          )
      else:
          self.register_parameter("beta", None)
  
      if self.track_running_stats:
          self.register_buffer(
              "num_batches_tracked", torch.tensor(0, dtype=torch.long)
          )
          if self.scale:
              # We initializing the scaling parameter following the proposal
              # of "Deep Complex Networks". Trabelsi C. et al.
  
              self.register_buffer(
                  "moving_Vrr",
                  torch.ones(self.num_complex_features)
                  * np.sqrt(1 / 2),
              )
              self.register_buffer(
                  "moving_Vii",
                  torch.ones(self.num_complex_features)
                  * np.sqrt(1 / 2),
              )
              self.register_buffer(
                  "moving_Vri", torch.zeros(self.num_complex_features)
              )
          else:
              self.register_parameter("moving_Vrr", None)
              self.register_parameter("moving_Vii", None)
              self.register_parameter("moving_Vri", None)
  
          if self.center:
              self.register_buffer(
                  "moving_mean",
                  torch.zeros(self.num_complex_features * 2),
              )
          else:
              self.register_parameter("moving_mean", None)
  
      else:
          self.register_parameter("moving_Vrr", None)
          self.register_parameter("moving_Vii", None)
          self.register_parameter("moving_Vri", None)
          self.register_parameter("moving_mean", None)
          self.register_parameter("num_batches_tracked", None)
      self.reset_parameters()
  
imports: import torch
  from torch.nn import Parameter
  import numpy
  from speechbrain.nnet.complex_networks.c_ops import multi_mean
label_desc: Use image node_id 1 to create a new CBatchNorm object from inherited base classes: torch.nn with example: obj = CBatchNorm(input_shape, input_size, dim, eps, momentum, scale, center, track_running_stats)