Hi,
you can reformulate this as matrix (of stacked embedding vector) multiplied with a (weight-) vector. Then (possibly after sprinkling transpose on the weight vector and result) you can use torch.mv 110.
For batch operation it might be easier to make the weight vector into a nx1 matrix and use torch.matmul 70.
Best regards
Thomas