def ops_to_dict(session, ops):
    """Converts canonical dict of TF ops to an actual dict.

    Runs ops first.

    Args:
        session: tf session
        ops: dict mapping name to tf operation

    Returns:
        dict
    """

    dict_ = dict(list(zip(list(ops.keys()), session.run(list(ops.values())))))

    return dict_