-
Notifications
You must be signed in to change notification settings - Fork 391
Open
Description
Hi, thanks for this awesome library!
At the moment, it is possible to use ... to match an arbitrary number of dimensions
einops.parse_shape(torch.zeros(1,2,3,4), "a ... c”) # {'a': 2, 'c': 4}However, we can’t know what was matched by the ...
Suggestion: we could introduce a *b character that would return a list of dimensions.
This way, the pattern "a *b c” would give the following results:
einops.parse_shape(torch.zeros(1,2), "a *b c") # {'a': 2, ‘b’: [], 'c': 2}
einops.parse_shape(torch.zeros(1,2,3), "a *b c") # {'a': 2, ‘b’: [2], 'c': 3}
einops.parse_shape(torch.zeros(1,2,3,4), "a *b c") # {'a': 2, ‘b’: [2,3], 'c': 4}Is it already possible to achieve this with the current API?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels