def naive_round(qf, gf, q_pids, g_pids, positive_indices=None, negative_indices=None, inplace=True, previous_distmat=None, device=None):
    '\n    qf: q x m\n    gf: g x m\n    q_pids: q\n    g_pids: g\n    positive_indices: q x g\n    negative_indices: q x g\n    previous_distmat: adjusted distmat (== compute_distmat(qf, gf) only at init)\n    '
    (q, g) = (qf.shape[0], gf.shape[0])
    assert (qf.shape[1] == gf.shape[1])
    if (positive_indices is None):
        positive_indices = init_feedback_indices(q, g, device=device)
    if (negative_indices is None):
        negative_indices = init_feedback_indices(q, g, device=device)
    if (previous_distmat is None):
        distmat = compute_distmat(qf, gf)
    else:
        distmat = previous_distmat
    res = greedy_feedback(distmat, q_pids, g_pids, positive_indices, negative_indices, inplace=inplace)
    (positive_indices, negative_indices, matches) = res
    distmat = compute_distmat(qf, gf)
    distmat[positive_indices] = 0
    distmat[negative_indices] = float('inf')
    return (distmat, positive_indices, negative_indices, matches)
qf: q x m
gf: g x m
q_pids: q
g_pids: g
positive_indices: q x g
negative_indices: q x g
previous_distmat: adjusted distmat (== compute_distmat(qf, gf) only at init)
def naive_round(qf, gf, q_pids, g_pids, positive_indices=None, negative_indices=None, inplace=True, previous_distmat=None, device=None):
    '\n    qf: q x m\n    gf: g x m\n    q_pids: q\n    g_pids: g\n    positive_indices: q x g\n    negative_indices: q x g\n    previous_distmat: adjusted distmat (== compute_distmat(qf, gf) only at init)\n    '
    (q, g) = (qf.shape[0], gf.shape[0])
    assert (qf.shape[1] == gf.shape[1])
    if (positive_indices is None):
        positive_indices = init_feedback_indices(q, g, device=device)
    if (negative_indices is None):
        negative_indices = init_feedback_indices(q, g, device=device)
    if (previous_distmat is None):
        distmat = compute_distmat(qf, gf)
    else:
        distmat = previous_distmat
    res = greedy_feedback(distmat, q_pids, g_pids, positive_indices, negative_indices, inplace=inplace)
    (positive_indices, negative_indices, matches) = res
    distmat = compute_distmat(qf, gf)
    distmat[positive_indices] = 0
    distmat[negative_indices] = float('inf')
    return (distmat, positive_indices, negative_indices, matches)