pytensor icon indicating copy to clipboard operation
pytensor copied to clipboard

Implement pack/unpack Ops

Open jessegrabowski opened this issue 4 months ago • 3 comments

Description

This came up in the context of #1550 . There are many cases where we want to be able to ravel a sequence of inputs into a single vector, do some computation, then reshape the outputs back into the original shapes. As was pointed out in #1552, this is exactly what einops pack/unpack does.

It would be great for us to have similar functionality, using numeric axes instead of the letter-based API.

I also tagged this as xtensor, because it makes sense for this functionality to also have an xtensor implementation (allowing you to pack/unpack using named dims)

jessegrabowski avatar Jul 26 '25 10:07 jessegrabowski