def split_div_mul(v):
  """Returns the base, div, and mul factor from a symbolic shape constant."""
  if "*" in v:
    arr = v.split("*")
    if len(arr) != 2:
      raise ValueError(f"Too many mults in features {v}.")
    v, mul = arr[0], int(arr[1])
  else:
    mul = 1
  if "%" in v:
    arr = v.split("%")
    if len(arr) != 2:
      raise ValueError(f"Too many divs in features {v}.")
    v, div = arr[0], int(arr[1])
  else:
    div = 1
  return v, div, mul