If the order of the tgt values doesn’t matter, this would work:
tgt = torch.tensor([3, 7, 3, 5, 11, 11, 11])
probs = torch.tensor([-0.2, -0.4, -0.5, -0.8, -0.1, -0.7, -0.2])

u, u_idx = tgt.unique(return_inverse=True)
ret = torch.zeros(len(u))
ret.scatter_add_(0, u_idx, probs)
print(ret)

and you could create the tuples if needed afterwards.