class_docstr: Maintains cumulative moving mean and std of incoming numpy arrays along axis 0.
  
  Output shapes:
  scalar -> scalar
  vector -> scalar
  matrix -> vector
  
  Implementation adopted from:
  https://github.com/DLR-RM/stable-baselines3/blob/master/stable_baselines3/common/running_mean_std.py
  
  :param epsilon: Ensures numerical stability and avoids division by zero.
class_docstr_tok: ["Maintains","cumulative","moving","mean","and","std","of","incoming","numpy","arrays","along","axis","0",".","Output","shapes",":","scalar","-",">","scalar","vector","-",">","scalar","matrix","-",">","vector","Implementation","adopted","from",":","https",":","\/\/github.com\/DLR-RM\/stable-baselines3\/blob\/master\/stable_baselines3\/common\/running_mean_std.py",":","param","epsilon",":","Ensures","numerical","stability","and","avoids","division","by","zero","."]
docstr: Update cumulative moving statistics.
  
  :param new_data: New data to update the stats with.
docstr_tok: ["Update","cumulative","moving","statistics",".",":","param","new_data",":","New","data","to","update","the","stats","with","."]
code: def update(self, new_data: Union[np.ndarray, float]) -> None:
      """Update cumulative moving statistics.
  
      :param new_data: New data to update the stats with.
      """
      if not isinstance(new_data, np.ndarray):
          new_data = np.asarray([new_data])
  
      batch_mean = new_data.mean(axis=0)
      batch_var = new_data.var(axis=0)
  
      if self.mean is None:
          self.mean = np.zeros_like(batch_mean)
          self.var = np.zeros_like(batch_var)
  
      batch_count = new_data.shape[0]
      self._update_from_moments(batch_mean, batch_var, batch_count)
  
file_path: maze/maze/core/utils/stats_utils.py
imports: from typing import Optional, Union
  import numpy
label_desc: Use image node_id 2 for calling the CumulativeMovingMeanStd obj's underlying member method code with example usage: obj.update(new_data) without return types