New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature suggestion] splatting list of anonymous dimensions of any length #182
Comments
Thank you, always glad to hear that einops is helpful.
What you suggest with named ellipsis is exactly how I was thinking about it. This pathway has some obstacles:
That said, I'd like to have named ellipses in the notation.
I think generally common use-case is "to (partially) reconstruct structure after the operation" and flattening is one of cases. There are some simple designs with objects-keepers, but they can't provide caching and scripting at the same time. |
@arogozhnikov whatever you think is best Alex! 馃檹 just wanted to incept the idea :) |
Hey @lucidrains, I believe https://github.com/arogozhnikov/einops/blob/master/docs/4-pack-and-unpack.ipynb |
@arogozhnikov omg! this is brilliant! 馃檹 |
can't wait for 0.6! |
Hi Alex again! 馃憢 Thank you again for this wonderful work 馃檹 I still can't get over how beautiful the abstraction is, and how much of a multiplier it is in my work.
I was wondering what your thoughts are about this potential extension to einops? A common pattern I run into is the need to flatten dimensions (for some operation), and then to reconstitute it later. To do this, I usually need to save the dimensions to a list or tuple, and then later run a reshape on the output. To do this with einops rearrange currently is difficult, as it is unable to take in a list of dimensions (it needs each dimension to be explicitly named), and there is no way to name the ellipsis-es.
I hacked up a prototype here lucidrains/memorizing-transformers-pytorch@b190c5e to give you an idea of the use-case. Would be curious to hear your thoughts, whether you can think of some even more general way to handle this with the internal ellipsis code you have already, or whether you think this doesn't belong in einops proper
Thank you!
The text was updated successfully, but these errors were encountered: