class_docstr: Performs mean and variance normalization of the input tensor.
  
  Arguments
  ---------
  mean_norm : True
       If True, the mean will be normalized.
  std_norm : True
       If True, the standard deviation will be normalized.
  norm_type : str
       It defines how the statistics are computed ('sentence' computes them
       at sentence level, 'batch' at batch level, 'speaker' at speaker
       level, while global computes a single normalization vector for all
       the sentences in the dataset). Speaker and global statistics are
       computed with a moving average approach.
  avg_factor : float
       It can be used to manually set the weighting factor between
       current statistics and accumulated ones.
  
  Example
  -------
  >>> import torch
  >>> norm = InputNormalization()
  >>> inputs = torch.randn([10, 101, 20])
  >>> inp_len = torch.ones([10])
  >>> features = norm(inputs, inp_len)
class_docstr_tok: ["Performs","mean","and","variance","normalization","of","the","input","tensor",".","Arguments","--","--","--","--","-","mean_norm",":","True","If","True",",","the","mean","will","be","normalized",".","std_norm",":","True","If","True",",","the","standard","deviation","will","be","normalized",".","norm_type",":","str","It","defines","how","the","statistics","are","computed","(","'sentence","'","computes","them","at","sentence","level",",","'batch","'","at","batch","level",",","'speaker","'","at","speaker","level",",","while","global","computes","a","single","normalization","vector","for","all","the","sentences","in","the","dataset",")",".","Speaker","and","global","statistics","are","computed","with","a","moving","average","approach",".","avg_factor",":","float","It","can","be","used","to","manually","set","the","weighting","factor","between","current","statistics","and","accumulated","ones",".","Example","--","--","--","-",">",">",">","import","torch",">",">",">","norm","=","InputNormalization","(",")",">",">",">","inputs","=","torch.randn","(","[","10",",","101",",","20","]",")",">",">",">","inp_len","=","torch.ones","(","[","10","]",")",">",">",">","features","=","norm","(","inputs",",","inp_len",")"]
docstr: Returns the tensor with the surrounding context.
  
  Arguments
  ---------
  x : tensor
      A batch of tensors.
docstr_tok: ["Returns","the","tensor","with","the","surrounding","context",".","Arguments","--","--","--","--","-","x",":","tensor","A","batch","of","tensors","."]
code: def _compute_current_stats(self, x):
      """Returns the tensor with the surrounding context.
  
      Arguments
      ---------
      x : tensor
          A batch of tensors.
      """
      # Compute current mean
      if self.mean_norm:
          current_mean = torch.mean(x, dim=0).detach().data
      else:
          current_mean = torch.tensor([0.0], device=x.device)
  
      # Compute current std
      if self.std_norm:
          current_std = torch.std(x, dim=0).detach().data
      else:
          current_std = torch.tensor([1.0], device=x.device)
  
      # Improving numerical stability of std
      current_std = torch.max(
          current_std, self.eps * torch.ones_like(current_std)
      )
  
      return current_mean, current_std
  
imports: import math
  import torch
  import logging
  from speechbrain.utils.checkpoints import mark_as_saver, mark_as_loader, mark_as_transfer, register_checkpoint_hooks
  from speechbrain.dataio.dataio import length_to_mask
label_desc: Use image node_id 3 for calling the InputNormalization obj's underlying member method code with example usage: obj._compute_current_stats(x) and returns: current_mean,  current_std