-
Notifications
You must be signed in to change notification settings - Fork 148
Rewrite concatenate([x, x]) as tile #1714
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Let's try with |
|
Btw would be nice to get rid of this join (and split) symbolic axis if you would like to work on that after this PR. relevant issue: #1528 |
|
Thanks @tchan102 Took a bit longer than expected because it touched some previous tests |
|
Thanks @ricardoV94 for reviewing this pull request and checking my errors, it's my first time contributing an open source project. I'm really appreciate your help and guidance. Looking forward to push more code to PyTensor! |
Add optimization for Join → Repeat when concatenating identical tensors
Description
This PR introduces a graph rewrite optimization in pytensor/tensor/rewriting/basic.py that replaces redundant Join operations with an equivalent and more efficient Repeat operation when all concatenated tensors are identical.
Example:
join(0, x, x, x) → repeat(x, 3, axis=0)
Key additions:
Related Issue
Checklist
Type of change