Implement Multi-Head Attention
Implement the forward pass of multi-head self-attention (no mask, no batch dimension).
Given input X (shape n x d), weight matrices Wq, Wk, Wv, Wo (all d x d) and number of heads h (d divisible by h)...
Example
Unlock to view complete problem details
and practice with sample input/output
Was this article helpful?
View Test Cases & Run Code requires membership
Standard Input
Execution Result:
