[BUG] einops should support floating point bound variables
marksandler2 opened this issue · comments
Mark Sandler commented
Describe the bug
Using floating point bound variables variables should work when changing the shape.
E.g. this:
einops.rearrange(jnp.zeros((10, 10)),'(i t) j -> i (t j)', t=0.5)
Should be equivalent to this:
einops.rearrange(jnp.zeros((10, 10)),'i (t j) -> (i t) j', t=2)
Reproduction steps
import einops
import jax.numpy as np
einops.rearrange(jnp.zeros((10, 10)),'(i t) j -> i (t j)', t=0.5)
Expected behavior
Return tensor 20x5. Instead it raised an exception:
Your platform
Python 3.10, einops version: 0.6.0, jax
Alex Rogozhnikov commented
einops should support floating point bound variables
no, it should not.
It's 1) totally unreadable 2) breaks "shapes visible from pattern" 3) ties behavior to non-verbalized state (dtypes).