Write shape assertions for the tensors in an attention forward pass

Correctness, Debugging, and Performance Experiments1 / 8

Chapter 261 / 8

Correctness, Debugging, and Performance Experiments

Write shape assertions for the tensors in an attention forward pass

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

Complete the starter code in the editor. Any correct approach is accepted.

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