[Feature suggestion] Support documentation-only names in repeat (and rearrange)
Author: fzimmermann89Created Nov 28, 2024Updated Feb 24, 2025
Labelsfeature suggestion
Jaxtyping has documentation-only names.
For example channel=2
Here, the name before the = is completely ignored and only serves a documentation purpose. The code behaves as-if there was only the anonymous number written.
instead of
repeat(tensor, "x -> 1 1 x")which lacks any information about what the new axes are, and
repeat(tensor, "x -> batch channel x", batch=1, channel=1)which makes it less obvious that the operation is an unsqueeze, it would be nice if one could write:
repeat(tensor, "x -> batch=1 channel=1 x")Would this be something to consider for einops as well? (I haven't seen an issue discussing this, if I missed it -- sorry!)
Source: arogozhnikov/einops