Skip to content

Implement vectorize for XTensor Ops#1876

Draft
ricardoV94 wants to merge 7 commits intopymc-devs:mainfrom
ricardoV94:xtensor_vectorize
Draft

Implement vectorize for XTensor Ops#1876
ricardoV94 wants to merge 7 commits intopymc-devs:mainfrom
ricardoV94:xtensor_vectorize

Conversation

@ricardoV94
Copy link
Member

@ricardoV94 ricardoV94 commented Feb 5, 2026

Some Ops are undefined, but most things are pretty straightforward.

The biggest challenge is when vectorization would imply new dimensions (say xtensor_from_tensor). There is no trivial way to allow the user to tell us what those dimension labels should be.

And sized operations (where numerical inputs determine output sizes). However those are equally tricky in tensor graphs.

I decided to implement most methods as an Op property. I think this should be the default, as it keeps code organized. Users can still implement their custom dispatch if it's missing, and we can offer a two level dispatch (not to accidentally override the error checking that is now done for all Ops before dispatching)

Missing tests

@ricardoV94 ricardoV94 force-pushed the xtensor_vectorize branch 2 times, most recently from 94d0dfd to 3fdc609 Compare February 6, 2026 16:14
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