Skip to content

Support XTensorSharedVariables#8096

Draft
ricardoV94 wants to merge 2 commits intopymc-devs:mainfrom
ricardoV94:handle_xtensor_variables_more_naturally
Draft

Support XTensorSharedVariables#8096
ricardoV94 wants to merge 2 commits intopymc-devs:mainfrom
ricardoV94:handle_xtensor_variables_more_naturally

Conversation

@ricardoV94
Copy link
Member

@ricardoV94 ricardoV94 commented Feb 8, 2026

Depends on pymc-devs/pytensor#1882

We were registering regular TensorSharedVariables in pymc.dims.Data, and then wrapping those in as_xtensor. The problem with that is that when you then try to act on m["x"] you were not acting on the same variable that pymc.dims.Data returned to you, instead you were acting on the input of as_xtensor...

This made it hard to adopt it in pymc-marketing

@codecov
Copy link

codecov bot commented Feb 8, 2026

Codecov Report

❌ Patch coverage is 76.47059% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.03%. Comparing base (11d0f1b) to head (abfdd9e).
⚠️ Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
pymc/dims/model.py 0.00% 4 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #8096      +/-   ##
==========================================
- Coverage   90.89%   88.03%   -2.87%     
==========================================
  Files         123      123              
  Lines       19501    19511      +10     
==========================================
- Hits        17726    17176     -550     
- Misses       1775     2335     +560     
Files with missing lines Coverage Δ
pymc/model/core.py 93.30% <100.00%> (ø)
pymc/model/fgraph.py 97.91% <100.00%> (-0.04%) ⬇️
pymc/model/transform/optimization.py 100.00% <100.00%> (ø)
pymc/dims/model.py 0.00% <0.00%> (-66.67%) ⬇️

... and 12 files with indirect coverage changes

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

@ricardoV94 ricardoV94 changed the title Handle xtensor variables more naturally Use variable agnostic view operation (so XTensorVariables are handled as well as TensorVariables) Feb 9, 2026
@ricardoV94 ricardoV94 changed the title Use variable agnostic view operation (so XTensorVariables are handled as well as TensorVariables) Use type agnostic view operation (so XTensorVariables are handled as well as TensorVariables) Feb 9, 2026
@ricardoV94 ricardoV94 force-pushed the handle_xtensor_variables_more_naturally branch from ba31b01 to abfdd9e Compare February 10, 2026 14:01
@ricardoV94 ricardoV94 changed the title Use type agnostic view operation (so XTensorVariables are handled as well as TensorVariables) Support XTensorSharedVariables Feb 10, 2026
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.

1 participant