Hello,
I need to have following operation:

y[i] = w * \sum_{j=1}^{i} x[j] + x[i]

Which is equivalent to torch.cumsum() if w := 1. However, in cases where we need to decay the summation by having 0 < w < 1, cumsum() won’t work. Any suggestions about how to go ahead in solving this problem?
Thanks,
Ahmed