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 theNatoms, formutual_field(): every pair appears in the row of each of its atoms. The pairs fromvalidon (a plan’s padding) go to an extra rowNthat 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.validmay be a count on the device (no host read). Withsorted_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.