# Raw attention scores (how much to focus on each word) scores = torch.tensor([2.0, 1.0, 3.0]) # [I, love, pizza] # Convert to probabilities (softmax) weights = F.softmax(scores, dim=0) print(weights) # [0.24, 0.09, 0.67] - pizza gets most attention