Something changed in `pytensor > 2.12.3` (and thus `pymc > 5.6.1`) that makes my `pytensor.gradient.grad` call get stuck - any ideas?

This looks extremely promising - thank you so much! It’s late here (10pm) so I’ll give it a try in the morning and report back. Looks like it’s definitely going down the right track though, and your gist is very helpful too - I’m hopeful this might unblock me :slight_smile: