Hitting a weird error to do with RNGs in Scan in a custom function inside a Potential

That’s perplexing, because this is essentially all jacobian is doing, see here. It uses an index sequence instead of scanning over the variables themselves, but my (admittedly uninformed) intuition is that these should generate equivalent graphs in the end.

I can’t do local tests over the weekend cuz I’m swamped with stuff, but I can circle back early next week if you don’t figure it out. I would suggest trying to boil this down to the simplest possible example to see if it’s a bug or what. Is it because it’s d(RV, data)? because it’s in a potential? Because it’s d(f(rv), data)? If the function matters, which function? etc etc.

1 Like