pytensor
pytensor copied to clipboard
Add correlate1d 1
Description
Related Issue
- [ ] Closes #
- [ ] Related to #
Checklist
- [ ] Checked that the pre-commit linting/style checks pass
- [ ] Included tests that prove the fix is effective or that the new feature works
- [ ] Added necessary documentation (docstrings and/or example notebooks)
- [ ] If you are a pro: each commit corresponds to a relevant logical change
Type of change
- [ ] New feature / enhancement
- [ ] Bug fix
- [ ] Documentation
- [ ] Maintenance
- [ ] Other (please specify):
Fixes #1321
Changes
- Added correlate1d function using convolve1d with flipped input
Type of change
- New feature / enhancement
@pre-commit-ci autofix
Do you have a use-case in mind for correlate? I'm inclined to not merge this because of how light the wrapper is. If you need it in a model you can just do pt.flip(pt.convolve1d(x)).
I think it's just API compat, but it should be called correlate: https://numpy.org/doc/2.1/reference/generated/numpy.correlate.html.
Or from scipy correlate and correlate2d (they don't seem ho have correlate1d)