xnn.trfnn.fast.et_kernels.attention_logits#

xnn.trfnn.fast.et_kernels.attention_logits(q, k, dk, src, dst, heads, key=None)[source]#

The fused logits sum_(f in h) q[dst] k[src] dk of every pair and head, (P, H).

Parameters:
  • q (Tensor) – Queries and keys (N, F).

  • k (Tensor) – Queries and keys (N, F).

  • dk (Tensor, optional) – The key filters of the pairs (P, F).

  • src (Tensor) – Neighbor and center of every pair (P,).

  • dst (Tensor) – Neighbor and center of every pair (P,).

  • heads (int) – Number of heads H (F divisible by it).

  • key (Tensor, optional) – The object that identifies the pair list for the sort cache (for example the edge index src and dst are rows of); by default src and dst themselves.

Returns:

(P, H).

Return type:

Tensor