def separate_gradients(gradients, weight_vars, input_vars):
    """
    split the gradient dictionary up into one for input and one for weights.

    Parameters
    ----------
    gradients: dict:
        dictionary of gradients. Should be str, list[Objective] key/value pairs.
    input_vars: list:
        the input variables of the Objective
    weight_vars: list:
        the internal weight variables of the Objective

    Returns
    -------
    tuple(dict):
        a pair of dictionaries, respectively the gradients for input and weight variables.
    """
    i_grad = {}
    w_grad = {}

    for var in input_vars:
        i_grad[var] = gradients[var]
    for var in weight_vars:
        w_grad[var] = gradients[var]
    return w_grad, i_grad