def get_att_type(dic):
    """
    Figure out what kind of attention and how many heads were used.
    Args:
        dic (dict): prediction dictionary
    Returns:
        num_heads (int): number of attention heads
        is_linear (bool): whether linear attention was used (as opposed
            to pair-wise).
    """
    num_weights_list = []
    num_confs_list = []

    for sub_dic in dic.values():
        num_learned_weights = sub_dic['learned_weights'].shape[0]
        num_confs = sub_dic['boltz_weights'].shape[0]

        if num_learned_weights in num_weights_list:
            continue

        if num_confs == 1:
            continue

        num_weights_list.append(num_learned_weights)
        num_confs_list.append(num_confs)

        if len(num_confs_list) == 2:
            break

    is_linear = ((num_weights_list[1] / num_weights_list[0])
                 == (num_confs_list[1] / num_confs_list[0]))
    if is_linear:
        num_heads = int(num_weights_list[0] / num_confs_list[0])
    else:
        num_heads = int((num_weights_list[0] / num_confs_list[0] ** 2))

    return num_heads, is_linear