Implement a function batched_attention_scores(Q, K) that computes scaled dot-product attention scores for a batched, multi-head input.
Given query tensor Q and key tensor K, both with shape (batch, num_heads, seq_len, head_dim), your function should:
Q with the transpose of K along the last two dimensions. The result has shape (batch, num_heads, seq_len, seq_len).sqrt(head_dim)..tolist()).Parameters:
Q: numpy array of shape (batch, num_heads, seq_len, head_dim)K: numpy array of shape (batch, num_heads, seq_len, head_dim)Returns:
(batch, num_heads, seq_len, seq_len).The transpose must be applied only to the last two dimensions of K, leaving the batch and head dimensions intact, so that each head in each batch computes its own independent score matrix.