#352·einops

[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

python
repeat(tensor, "x -> 1 1 x")

which lacks any information about what the new axes are, and

python
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:

python
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!)