Write shape assertions for the tensors in an attention forward pass

Research Engineering & Debugging1 / 8

Chapter 251 / 8

Research Engineering & Debugging

Write shape assertions for the tensors in an attention forward pass

Easy
Target interface
attention_forward(q, k, v, mask=None)

Implement the function/class skeleton in the editor. Any correct approach is accepted.

Hints0 / 2
Reference solution
Your own code stays in the editor.