def saves_to_partial_epochs(epochs, saves):
    """epochs is a list of epochs, and saves[k] is a list of all the saves for epoch k. This utility converts these two
    lists into a single list that shows all of the (fractional) epochs at which saves occur. For instance,
    epochs = [0,1,2,3] and saves=[[0,1],[0,1],[0,1],[0]] would result in a return value of [0, 0.5, 1, 1.5, 2, 2.5, 3]"""
    partial_epochs = []
    for epoch_id, epoch in enumerate(epochs):
        num_saves = len(saves[epoch_id])
        epoch_frac = 1/num_saves
        partial_epochs.append(epoch)
        for save in saves[epoch_id]:
            if save != 0:
                partial_epochs.append(epoch + save*epoch_frac)
    return partial_epochs