class_docstr: A global normalization module - computes a single mean and standard deviation
  for the entire batch across unmasked positions and uses it to normalize the
  inputs to the desired mean and standard deviation.
  
  This normalization is reversible - it is possible to use the .denormalize()
  method to reover the original values.
  
  Arguments
  ---------
  norm_mean: float
      the desired normalized mean
  norm_std: float
      the desired normalized standard deviation
  update_steps: float
      the number of steps over which statistics will be collected
  length_dim: int
      the dimension used to represent the length
  mask_value: float
      the value with which to fill masked positions
      without a mask_value, the masked positions would be normalized,
      which might not be desired
  
  Example
  -------
  >>> import torch
  >>> from speechbrain.processing.features import GlobalNorm
  >>> global_norm = GlobalNorm(
  ...     norm_mean=0.5,
  ...     norm_std=0.2,
  ...     update_steps=3,
  ...     length_dim=1
  ... )
  >>> x = torch.tensor([[1., 2., 3.]])
  >>> x_norm = global_norm(x)
  >>> x_norm
  tensor([[0.3000, 0.5000, 0.7000]])
  >>> x = torch.tensor([[5., 10., -4.]])
  >>> x_norm = global_norm(x)
  >>> x_norm
  tensor([[0.6071, 0.8541, 0.1623]])
  >>> x_denorm = global_norm.denormalize(x_norm)
  >>> x_denorm
  tensor([[ 5.0000, 10.0000, -4.0000]])
  >>> x = torch.tensor([[100., -100., -50.]])
  >>> global_norm.freeze()
  >>> global_norm(x)
  tensor([[ 5.3016, -4.5816, -2.1108]])
  >>> global_norm.denormalize(x_norm)
  tensor([[ 5.0000, 10.0000, -4.0000]])
  >>> global_norm.unfreeze()
  >>> global_norm(x)
  tensor([[ 5.3016, -4.5816, -2.1108]])
  >>> global_norm.denormalize(x_norm)
  tensor([[ 5.0000, 10.0000, -4.0000]])
class_docstr_tok: ["A","global","normalization","module","-","computes","a","single","mean","and","standard","deviation","for","the","entire","batch","across","unmasked","positions","and","uses","it","to","normalize","the","inputs","to","the","desired","mean","and","standard","deviation",".","This","normalization","is","reversible","-","it","is","possible","to","use","the",".denormalize","(",")","method","to","reover","the","original","values",".","Arguments","--","--","--","--","-","norm_mean",":","float","the","desired","normalized","mean","norm_std",":","float","the","desired","normalized","standard","deviation","update_steps",":","float","the","number","of","steps","over","which","statistics","will","be","collected","length_dim",":","int","the","dimension","used","to","represent","the","length","mask_value",":","float","the","value","with","which","to","fill","masked","positions","without","a","mask_value",",","the","masked","positions","would","be","normalized",",","which","might","not","be","desired","Example","--","--","--","-",">",">",">","import","torch",">",">",">","from","speechbrain.processing.features","import","GlobalNorm",">",">",">","global_norm","=","GlobalNorm","(","...","norm_mean=0.5",",","...","norm_std=0.2",",","...","update_steps=3",",","...","length_dim=1","...",")",">",">",">","x","=","torch.tensor","(","[","[","1.",",","2.",",","3",".","]","]",")",">",">",">","x_norm","=","global_norm","(","x",")",">",">",">","x_norm","tensor","(","[","[","0.3000",",","0.5000",",","0.7000","]","]",")",">",">",">","x","=","torch.tensor","(","[","[","5.",",","10.",",","-4",".","]","]",")",">",">",">","x_norm","=","global_norm","(","x",")",">",">",">","x_norm","tensor","(","[","[","0.6071",",","0.8541",",","0.1623","]","]",")",">",">",">","x_denorm","=","global_norm.denormalize","(","x_norm",")",">",">",">","x_denorm","tensor","(","[","[","5.0000",",","10.0000",",","-4.0000","]","]",")",">",">",">","x","=","torch.tensor","(","[","[","100.",",","-100.",",","-50",".","]","]",")",">",">",">","global_norm.freeze","(",")",">",">",">","global_norm","(","x",")","tensor","(","[","[","5.3016",",","-4.5816",",","-2.1108","]","]",")",">",">",">","global_norm.denormalize","(","x_norm",")","tensor","(","[","[","5.0000",",","10.0000",",","-4.0000","]","]",")",">",">",">","global_norm.unfreeze","(",")",">",">",">","global_norm","(","x",")","tensor","(","[","[","5.3016",",","-4.5816",",","-2.1108","]","]",")",">",">",">","global_norm.denormalize","(","x_norm",")","tensor","(","[","[","5.0000",",","10.0000",",","-4.0000","]","]",")"]
docstr: Returns the length mask for the specified tensor
  
  Arguments
  ---------
  x: torch.Tensor
      the tensor for which the mask will be obtained
  
  lengths: torch.Tensor
      the length tensor
  
  Returns
  -------
  mask: torch.Tensor
      the mask tensor
docstr_tok: ["Returns","the","length","mask","for","the","specified","tensor","Arguments","--","--","--","--","-","x",":","torch.Tensor","the","tensor","for","which","the","mask","will","be","obtained","lengths",":","torch.Tensor","the","length","tensor","Returns","--","--","--","-","mask",":","torch.Tensor","the","mask","tensor"]
code: def get_mask(self, x, lengths):
      """Returns the length mask for the specified tensor
  
      Arguments
      ---------
      x: torch.Tensor
          the tensor for which the mask will be obtained
  
      lengths: torch.Tensor
          the length tensor
  
      Returns
      -------
      mask: torch.Tensor
          the mask tensor
      """
      max_len = x.size(self.length_dim)
      mask = length_to_mask(lengths * max_len, max_len)
      for dim in range(1, x.dim()):
          if dim != self.length_dim:
              mask = mask.unsqueeze(dim)
      mask = mask.expand_as(x).bool()
      return mask
  
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 4 for calling the GlobalNorm obj's underlying member method code with example usage: obj.get_mask(x, lengths) and returns: mask