def scale_filters(filters, multiplier, base):
  """Scale `filters` by `factor`and round to the nearest multiple of `base`.

  Args:
    filters: Positive integer. The original filter size.
    multiplier: Positive float. The factor by which to scale the filters.
    base: Positive integer. The number of filters will be rounded to a multiple
        of this value.

  Returns:
    Positive integer, the scaled filter size.
  """
  round_half_up = int(filters * multiplier / base + 0.5)
  result = int(round_half_up * base)
  return max(result, base)