pytensor
pytensor copied to clipboard
Rewrite scalar dot as multiplication #1205
Description
- Optimized local_blockwise_dot_to_mul to handle (1,1) @ (1,1) cases as direct elementwise multiplication.
- Prevents unnecessary reshaping for scalar-like tensors.
- Ensures consistency with other elementwise multiplication cases.
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):
📚 Documentation preview 📚: https://pytensor--1263.org.readthedocs.build/en/1263/