Skip to content

Implement Uniform and TruncatedNormal dims distributions#8065

Merged
jessegrabowski merged 2 commits intopymc-devs:mainfrom
ricardoV94:dim_interval
Jan 26, 2026
Merged

Implement Uniform and TruncatedNormal dims distributions#8065
jessegrabowski merged 2 commits intopymc-devs:mainfrom
ricardoV94:dim_interval

Conversation

@ricardoV94
Copy link
Member

With the constraint that for free rvs the bounds must be constant. This touches on a limitation we have on transforms that depend on parameters. The previous strategy was to pass the rv inputs to the transform, but this doesn't work for derived variables like XTensorFromTensor and DimShuffled RVs, since the inputs of those are not the ones needed for the transform.

I'll be thinking about how to better handle this, so we can lift the restriction.

Also fixes a bug in eval_rv_shapes with XTensorVariables for which .shape returns tuples instead of a tensor

@ricardoV94 ricardoV94 changed the title Implement Uniform and TruncatedNormal dims variable Implement Uniform and TruncatedNormal dims distributions Jan 21, 2026
@codecov
Copy link

codecov bot commented Jan 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.83%. Comparing base (5ff12c8) to head (97f9fda).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #8065      +/-   ##
==========================================
+ Coverage   90.80%   90.83%   +0.02%     
==========================================
  Files         121      121              
  Lines       19443    19500      +57     
==========================================
+ Hits        17656    17713      +57     
  Misses       1787     1787              
Files with missing lines Coverage Δ
pymc/dims/distributions/scalar.py 96.27% <100.00%> (+0.65%) ⬆️
pymc/dims/distributions/transforms.py 100.00% <100.00%> (ø)
pymc/model/core.py 93.30% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ricardoV94
Copy link
Member Author

Also fixes a bug in eval_rv_shapes with XTensorVariables for which .shape returns tuples instead of a tensor

If you wonder why, I think that's what .shape should return so I decided to take that approach with XTensorVariables which are fresh anyway. Can reconsider.

This wouldn't have been a problem if pytensor function supported arbitrary tuple/list input/output format like any modern jit library does... We should open an issue for that

Copy link
Member

@OriolAbril OriolAbril left a comment

Choose a reason for hiding this comment

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

everything looks and sounds good, I'll try to join the hackathons starting next week to go back to more active contributions on label related things

@ricardoV94
Copy link
Member Author

@OriolAbril was there a reason you didn't approve the PR? Did you want someone else to review?

@jessegrabowski jessegrabowski merged commit 4d8bbe9 into pymc-devs:main Jan 26, 2026
42 checks passed
@ricardoV94 ricardoV94 deleted the dim_interval branch January 26, 2026 13:19
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.

3 participants