class_docstr: This class is used to instantiate the complex
  layer-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 dimension.
  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).
  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).
  
  Example
  -------
  >>> inp_tensor = torch.rand([10, 16, 30])
  >>> CBN = CLayerNorm(input_shape=inp_tensor.shape)
  >>> out_tensor = CBN(inp_tensor)
  >>> out_tensor.shape
  torch.Size([10, 16, 30])
class_docstr_tok: ["This","class","is","used","to","instantiate","the","complex","layer-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","dimension",".","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",")",".","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",")",".","Example","--","--","--","-",">",">",">","inp_tensor","=","torch.rand","(","[","10",",","16",",","30","]",")",">",">",">","CBN","=","CLayerNorm","(","input_shape=inp_tensor.shape",")",">",">",">","out_tensor","=","CBN","(","inp_tensor",")",">",">",">","out_tensor.shape","torch.Size","(","[","10",",","16",",","30","]",")"]
docstr: Computes the complex normalization.
docstr_tok: ["Computes","the","complex","normalization","."]
code: def forward(self, input):
      """Computes the complex normalization."""
      input_shape = input.size()
      ndim = input.dim()
      reduction_axes = list(range(ndim))
      del reduction_axes[self.dim]
      del reduction_axes[0]
      input_dim = input_shape[self.dim] // 2
  
      # Get the mean and center
      mu = multi_mean(input, reduction_axes, True)
      if self.center:
          input_centred = input - mu
      else:
          input_centred = input
  
      centred_squared = input_centred**2
  
      if self.dim == 1 or ndim == 2:
          centred_squared_real = centred_squared[:, :input_dim]
          centred_squared_imag = centred_squared[:, input_dim:]
          centred_real = input_centred[:, :input_dim]
          centred_imag = input_centred[:, input_dim:]
      elif self.dim == -1 and ndim == 3:
          centred_squared_real = centred_squared[:, :, :input_dim]
          centred_squared_imag = centred_squared[:, :, input_dim:]
          centred_real = input_centred[:, :, :input_dim]
          centred_imag = input_centred[:, :, input_dim:]
      elif self.dim == -1 and ndim == 4:
          centred_squared_real = centred_squared[:, :, :, :input_dim]
          centred_squared_imag = centred_squared[:, :, :, input_dim:]
          centred_real = input_centred[:, :, :, :input_dim]
          centred_imag = input_centred[:, :, :, input_dim:]
      else:
          centred_squared_real = centred_squared[:, :, :, :, :input_dim]
          centred_squared_imag = centred_squared[:, :, :, :, input_dim:]
          centred_real = input_centred[:, :, :, :, :input_dim]
          centred_imag = input_centred[:, :, :, :, input_dim:]
  
      if self.scale:
          Vrr = (
              multi_mean(
                  centred_squared_real,
                  axes=reduction_axes,
                  keepdim=True,
              )
              + self.eps
          )
          Vii = (
              multi_mean(
                  centred_squared_imag,
                  axes=reduction_axes,
                  keepdim=True,
              )
              + self.eps
          )
  
          Vri = multi_mean(
              centred_real * centred_imag,
              axes=reduction_axes,
              keepdim=True,
          )
      else:
          Vrr = None
          Vii = None
          Vri = None
  
      return c_norm(
          input_centred,
          Vrr,
          Vii,
          Vri,
          self.beta,
          self.gamma_rr,
          self.gamma_ri,
          self.gamma_ii,
          self.scale,
          self.center,
          dim=self.dim,
          layernorm=True,
      )
  
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 3 for calling the CLayerNorm obj's underlying member method code with example usage: obj.forward(input) and returns: c_norm