Not that I’m aware of.
However, you could manually split the tensor and sum the chunks:
start_idx = 0
for l in lengths:    
    print(x.narrow(0, start_idx, l).sum())
    start_idx += l

I haven’t timed it, but depending on the tensor shape, you are better off using split and then summing each chunk in a loop.