pymc
pymc copied to clipboard
Add a function to create a tensor that represents the loop over the posterior
Description
This PR adds the loop_over_posterior function. It complements vectorize_over_posterior and can be used whenever vectorize_graph is not implemented for some nodes in the computational graph (i.e. some kinds of AdvancedSetSubtensor raise NotImplementedError when trying to vectorize them).
Related Issue
- [ ] Closes #
- [ ] Related to #
Checklist
- [X] Checked that the pre-commit linting/style checks pass
- [X] Included tests that prove the fix is effective or that the new feature works
- [X] Added necessary documentation (docstrings and/or example notebooks)
- [X] If you are a pro: each commit corresponds to a relevant logical change
Type of change
- [X] New feature / enhancement
- [ ] Bug fix
- [ ] Documentation
- [ ] Maintenance
- [ ] Other (please specify):
📚 Documentation preview 📚: https://pymc--7885.org.readthedocs.build/en/7885/