def _make_count_and_weights_means_accumulator(sum_positive, weights_sum_total,
                                              count):
  """Create a WeightedMeanAndVarCombiner according to the parameter values."""
  # TODO(b/165003832): We're going back and forth from lists to numpy here.
  # Can we remove this overhead?
  if weights_sum_total is None:
    mean = np.array(sum_positive) / count
    weight = None
  else:
    mean = np.array(sum_positive) / weights_sum_total
    weight = weights_sum_total / count

  return analyzers.WeightedMeanAndVarCombiner.accumulator_class(
      count=np.array(count),
      mean=mean,
      variance=np.array(0.),  # Variance is not used for vocabularies.
      weight=weight)
Create a WeightedMeanAndVarCombiner according to the parameter values.
tensorflow_transform/beam/analyzer_impls.py