This has been brought up in a related issue, which has been implemented. There is now a built-in function which does just that: torch.linalg.vecdot.