-
Notifications
You must be signed in to change notification settings - Fork 0
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RFC] Adopt einops as an API for shape-changing operations #3
Comments
Thanks @arogozhnikov for this proposal! A question of scope: you just proposed
I wouldn't say the main source, but certainly an important source of issues.
This does indeed seem like a good time to consider
This coordination is indeed something that we'd like to see happen in this Consortium. We cannot standardize something that isn't adopted by libraries yet, but we can review We haven't quite worked out the formal process for this, but we are about to write up and discuss the proposal for evolution of the standard. I imagine in the case of This issue is probably a good place to take a "temperature reading" from maintainers of the various array libraries. No one can give a definitive verdict probably, but an indication is good enough. With my NumPy hat on: I suspect NumPy will be interested - |
Thanks for comments @rgommers
Great to hear that. Agree about "temperature reading" - opinions and questions are welcome.
Correct, reduce may be revealed later. One can think of Open to standardizing all three functions, but discussing in scope of one operation may be easier.
Maybe I phrased that bad, but that's exactly my thought - we don't need to deprecate existing functions, but can still have aligned APIs
That sounds like the right sequence of steps. Let me know when there is more clarity about processes what is my part/how can I help. |
Changing several core elements of array manipulations allows writing clean and reliable code AND resolves many conflicts.
Einops is a minimalist notation for tensor manipulations that replaces following operations:
For example, transposition
In
einops
is written asThere are only three operations, please read tutorial.
Motivation
einops is already implemented and works over a number of frameworks
solves the problem of interface conflicts that data-apis tries to solve (only for some operations, but covered subset of operations is probably the main source of discrepancies)
verbose API has multiple advantages (demonstrated here) and helps other people to follow code which is non-trivial for tensor packages
view / reshape are dangerous operations: they can completely break tensor structure, while mistakes done with them are almost non-catchable (when dealing with just a bunch of numbers in an intermediate activation, it is impossible to know those are ordered in a wrong way).
einops
replaces these operations, adds checks and makes it impossible to break tensor structureWhile this looks like a big leap, it is a surprisingly good moment to make it: move to more reliable and transferable code without depreciating parts of existing API. In this scenario first transition would be made by libs' developers, which will simplify following wider adoption.
In case of positive decision, introduction of new features and operations in einops will be first coordinated with/by consortium to ensure identical and efficient support by all frameworks.
The text was updated successfully, but these errors were encountered: