Skip to content
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

Reshape simplicity #577

Merged
merged 2 commits into from
Jan 30, 2025
Merged

Reshape simplicity #577

merged 2 commits into from
Jan 30, 2025

Conversation

inducer
Copy link
Owner

@inducer inducer commented Jan 30, 2025

@a-alveyblanc, could you review, since this touches code you wrote?

cc @nkoskelo

Closes #575.
Closes #574.

nkoskelo and others added 2 commits January 30, 2025 14:50
- Better handle 1-long axes in old and new shapes
- Avoid generating modulo expressions for direct pass-through
Comment on lines +91 to +94
if old_shape == new_shape:
# Avoid generating modulo expressions for direct pass-through
assert len(old_shape) == 1
return (index_vars[0],)
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may help avoid (quite) a few unnecessary modulos.

@a-alveyblanc
Copy link
Contributor

LGTM!

@inducer inducer merged commit b73a556 into main Jan 30, 2025
11 checks passed
@inducer inducer deleted the reshape-simplicity branch January 30, 2025 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Lowering a Reshape to IndexLambda should produce simple expressions if possible
3 participants