def example_rates_to_pmf(example_rates):
  """Creates a probability-mass-function based on relative example rates.

  Args:
    example_rates: a list or tuple
  Returns:
    a list of floats
  """
  total = sum(example_rates)
  return [r / total for r in example_rates]
Creates a probability-mass-function based on relative example rates.

  Args:
    example_rates: a list or tuple
  Returns:
    a list of floats
  
tensor2tensor/data_generators/multi_problem_v2.py