Guide
Database
Datasets
API reference
hetero_nsa
masked_attention_block
masked_gin_conv
nsa_encoder
self_attention_block
stoichiometric_hypergraph_conv
Bases: Module
Module
Self-Attention Block (SAB) with device-adaptive implementation.
Uses flex_attention on GPU and standard attention on CPU.
Forward pass for the SAB.
x – Input tensor of shape [batch_size, seq_len, hidden_dim]
Output tensor of same shape as input