Question 1: Single choice
mediumAI-checkedPyTorchMulti-head attention ends by merging the heads back into one dimension:
b, num_tokens, num_heads, head_dim = 2, 6, 3, 4
context = torch.randn(b, num_heads, num_tokens, head_dim) # attn_weights @ values
out = context.transpose(1, 2).view(b, num_tokens, num_heads * head_dim)
What happens on the last line?