xnn.ffnn.models.amoeba_kernels.pair_rows#

xnn.ffnn.models.amoeba_kernels.pair_rows(i_, k_, N, valid=None, sorted_i=False)[source]#

The compressed rows of the unique pairs (i, k) over the N atoms, for mutual_field(): every pair appears in the row of each of its atoms. The pairs from valid on (a plan’s padding) go to an extra row N that no program walks: in the rows of their atoms they would make one program walk the whole padding. Returns the row pointers (N + 2,), the pair of every entry and the atom at its other end (2 M,), all int32. valid may be a count on the device (no host read). With sorted_i (a plan’s pairs, sorted by their first atom) the first atoms’ entries are in place already and only the second atoms’ are sorted: the same rows, from a sort of half the entries.

Parameters:
Return type:

tuple