code: def _mean_var_count_from_moments(
      mean, var, count, batch_mean, batch_var, batch_count
  ):
      delta = batch_mean - mean
      tot_count = count + batch_count
  
      new_mean = mean + delta * batch_count / tot_count
      m_a = var * count
      m_b = batch_var * batch_count
      M2 = (
          m_a
          + m_b
          + torch.square(delta) * count * batch_count / tot_count
      )
      new_var = M2 / tot_count
      new_count = tot_count
  
      return new_mean, new_var, new_count
  
imports: import copy
  import dataclasses
  import logging
  import torch
  import moolib
label_desc: Use image node_id 1 for calling a global function with example usage: _mean_var_count_from_moments(mean, var, count, batch_mean, batch_var, batch_count) and returns: new_mean,  new_var,  new_count