a = torch.tensor([1,2,3,4,5,6,7,8,9])
b = [3,2,4]
I want to get a result == tensor([6, 9, 30]) where 6 == 1+2+3(three elements), 9 == 4+5(two elements), 30 == 6+7+8+9(four elements).
How to do this in Pytorch efficiently?