def cluster_queries(Q, query_lengths, C, I, B):
    (N, H, L, E) = Q.shape
    planes = Q.new_empty((B, (E + 1)))
    normal_(planes)
    planes[:, (- 1)] = 0
    hashes = compute_hashes(Q.view(((N * H) * L), E), planes).view(N, H, L)
    (groups, counts) = cluster(hashes, query_lengths, clusters=C, iterations=I, bits=B)
    return (groups, counts)
def cluster_queries(Q, query_lengths, C, I, B):
    (N, H, L, E) = Q.shape
    planes = Q.new_empty((B, (E + 1)))
    normal_(planes)
    planes[:, (- 1)] = 0
    hashes = compute_hashes(Q.view(((N * H) * L), E), planes).view(N, H, L)
    (groups, counts) = cluster(hashes, query_lengths, clusters=C, iterations=I, bits=B)
    return (groups, counts)