Multi-head causal attention tested against PyTorch SDPA
Implement batched multi-head attention with causal and padding masks and match scaled_dot_product_attention outputs and gradients across dtypes and edge cases.
Not attemptedSelf-directed project (PyTorch documentation as reference)Access: free
The exercise happens on Self-directed project (PyTorch documentation as reference). Canonical link: https://docs.pytorch.org/docs/stable/generated/torch.nn.functional.scaled_dot_product_attention.html. Link check: link responded (5 Oct 2026). Opened from this app 0 times; opening is not counted as an attempt.
Supports: The common "implement attention" coding exercise in research-engineering interviews.
Record an attempt
Attempt history
No attempts recorded yet.