Skip to content

Canonicalize subtensor negative integer indices #1541

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

Merged
merged 1 commit into from
Jul 15, 2025

Conversation

ricardoV94
Copy link
Member

@ricardoV94 ricardoV94 commented Jul 14, 2025

@ricardoV94 ricardoV94 force-pushed the canonicalize_negative_indices branch from 5516080 to 956b9e2 Compare July 15, 2025 10:46
@ricardoV94 ricardoV94 marked this pull request as ready for review July 15, 2025 10:46
Copy link

codecov bot commented Jul 15, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.91%. Comparing base (b4522d2) to head (956b9e2).
Report is 2 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1541      +/-   ##
==========================================
+ Coverage   81.86%   81.91%   +0.05%     
==========================================
  Files         230      230              
  Lines       52508    52529      +21     
  Branches     9339     9345       +6     
==========================================
+ Hits        42984    43029      +45     
+ Misses       7092     7070      -22     
+ Partials     2432     2430       -2     
Files with missing lines Coverage Δ
pytensor/tensor/rewriting/subtensor.py 90.09% <100.00%> (+0.28%) ⬆️

... and 4 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

for i, (dim_length, idx) in enumerate(zip(x.type.shape, idxs)):
if (
dim_length is None
or isinstance(idx, slice)
Copy link
Member

Choose a reason for hiding this comment

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

We could also canonicalize negative slices if they're static, is that out of scope here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes. Slices touch on the whole subtensor_merge monster and I don't want to touch it for now

@ricardoV94 ricardoV94 merged commit 4d539fa into pymc-devs:main Jul 15, 2025
73 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants