-
Notifications
You must be signed in to change notification settings - Fork 336
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
[FR] Optional channels #49
Comments
@ehknight thanks for coming up with suggestion. I've been previously considering this feature, however it is quite difficult to generalize beyond a single optional dimension.
where ellipsis can be 0 or 1 dimensions (or more). However, right now that's not yet supported and is subject of #43 |
@ehknight that's implemented now and will become a part of the next release |
It looks like transformations like |
@shoyer that's right, those expressions are disallowed. Let's analyze your example: (b ...) left part implies there is one dimension which should be decomposed in |
Ellipsis collapsing is now available as a part of einops 0.3 release. |
Sometimes, I find myself working lists of tensors in which one tensor has a shape
(b, c)
(forc
classes) and another tensor has shape(b,)
(for a single class). My current approach is to pad the tensors that have only one class with an additional channel dimension, userearrange
on the list, and then squeeze the dimensions that need to be squeezed.A great alternative to this would be supporting optional channels. Perhaps you could notate them with a question mark:
rearrange(x, "b c? -> (b c?)")
.The text was updated successfully, but these errors were encountered: