Solved by KFrank in post #2 
              
              
                Hi Alpha! 

The best I can think of is to use pytorch’s “standard” cumsum() and 
use roll() to right-shift the result: 
>>> t = torch.tensor ([1, 2, 3])
>>> res = t.cumsum (0).roll (1, 0)
>>> res[0] = 0
>>> print (res)
tensor([0, 1, 3])

Best. 
K. Frank