xnn.ffnn.models.geometry.excluded_pairs#

xnn.ffnn.models.geometry.excluded_pairs(i, k, excl_index, n, B, module)[source]#

Whether each pair (i, k) of a batch of B copies of a topology of n atoms is one of its excluded pairs excl_index (2, E) (in either order), looked up in their sorted keys (made once per batch size and device, cached on module).

Parameters:
  • i (Tensor) – Atom indices of the batch (P,).

  • k (Tensor) – Atom indices of the batch (P,).

  • excl_index (Tensor) – The excluded pairs (2, E) of one structure.

  • n (int) – Atoms per structure.

  • B (int) – Structures in the batch.

  • module (torch.nn.Module) – The model holding the cache.

Returns:

(P,) booleans.

Return type:

Tensor