AI article
Shapes are the type system of ML, and nobody checks them for you
Community description: Part 3 of From code to weights, a 12-part series on ML...
Dev.to | Sep 24, 2026 | Carlos Chinchilla Corbacho
Automated excerpt
Attention scores have shape [B, T, T], one T × T matrix per sequence. With B = 8 and T = 16, scores + mask raises: 16 is not 8. The rule aligns [16, 16] against [16, 16, 16] from the right and reads the mask as [1, B, T].
Selected automatically from source text; not independently written or fact-checked. Read the original for full context.