Skip to content

Add @ (matmul) operator to XTensorVariable#2128

Merged
ricardoV94 merged 2 commits into
pymc-devs:mainfrom
williambdean:xtensor-matmul
May 13, 2026
Merged

Add @ (matmul) operator to XTensorVariable#2128
ricardoV94 merged 2 commits into
pymc-devs:mainfrom
williambdean:xtensor-matmul

Conversation

@williambdean
Copy link
Copy Markdown
Contributor

Add __matmul__ and __rmatmul__ to XTensorVariable, delegating to dot — matching how xarray's DataArray implements @.

x @ y contracts over shared named dims: (a, b) @ (b, c)(a, c).

Relates to #1501

Add __matmul__ and __rmatmul__ to XTensorVariable, delegating to dot
matching xarray's DataArray implementation.

Relates to pymc-devs#1501
@williambdean williambdean requested a review from ricardoV94 May 13, 2026 16:00
Copy link
Copy Markdown
Member

@ricardoV94 ricardoV94 left a comment

Choose a reason for hiding this comment

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

test nits, looks good otherwise

Comment thread tests/xtensor/test_math.py Outdated
Comment thread tests/xtensor/test_math.py Outdated
@williambdean
Copy link
Copy Markdown
Contributor Author

williambdean commented May 13, 2026

Failure seems unrelated.

EDIT: Passing now.

@ricardoV94 ricardoV94 merged commit 2732452 into pymc-devs:main May 13, 2026
66 checks passed
@williambdean williambdean deleted the xtensor-matmul branch May 13, 2026 20:13
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