Nope, I never found an answer. I ended up using a combination of torch.cumsum and torch.cumprod to implement the operation that I needed, but it would still be convenient for PyTorch to have a scan primitive that accepts an arbitrary binary operator, like in TensorFlow/Theano or even Thrust.