Implement PyTorch multi-head attention with head splitting, scaled softmax attention, concatenation, and output projection.