Implement Grouped Query Attention Forward Pass

Problem: Implement the Forward Pass of Grouped Query Attention / GQA

Given Query, Key, and Value tensors, implement the forward pass of Grouped Query Attention without masks.

Tensor shapes:

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: