def sum_labeled_weights(
    accs: List[Tuple[float, List[float]]]) -> Tuple[float, List[float]]:
  """Sums up a collection of labeled-weight tables.

  Args:
    accs: a list of (w, lw) tuples, where w is the total weight (floating point)
      and lw is a list of weights for each label.

  Returns:
    component-wise sum of the inputs in the same format.
  """
  total_weight, labeled_weights = 0., []
  for acc in accs:
    total_weight = total_weight + acc[0]
    accumulator_labeled_weights = acc[1]
    if len(accumulator_labeled_weights) > len(labeled_weights):
      labeled_weights.extend(
          [0.] * (len(accumulator_labeled_weights) - len(labeled_weights)))
    for i in range(len(accumulator_labeled_weights)):
      labeled_weights[i] = labeled_weights[i] + accumulator_labeled_weights[i]
  return (total_weight, labeled_weights)
Sums up a collection of labeled-weight tables.

  Args:
    accs: a list of (w, lw) tuples, where w is the total weight (floating point)
      and lw is a list of weights for each label.

  Returns:
    component-wise sum of the inputs in the same format.
  
tensorflow_transform/beam/analyzer_impls.py