Skip to content
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

Minor typing issue #6473

Closed
NeilGirdhar opened this issue Apr 16, 2021 · 2 comments
Closed

Minor typing issue #6473

NeilGirdhar opened this issue Apr 16, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@NeilGirdhar
Copy link
Contributor

import jax.numpy as jnp
x: jnp.ndarray = jnp.zeros(10)
y = x.reshape((10,))
reveal_type(x)  # a.py:4: note: Revealed type is 'jax._src.numpy.lax_numpy.ndarray'
reveal_type(y)  # a.py:5: note: Revealed type is 'numpy.ndarray'
x = y  # error: Incompatible types in assignment (expression has type "numpy.ndarray", variable has type "jax._src.numpy.lax_numpy.ndarray")
@NeilGirdhar NeilGirdhar added the bug Something isn't working label Apr 16, 2021
@jakevdp
Copy link
Collaborator

jakevdp commented Apr 16, 2021

Thanks for the report! I suspect you'll find this issue barely scratches the surface of the typing issues in jax.numpy; almost none of the functions therein are accurately type-annotated, mainly because the effort is blocked by fundamental challenges in applying Python type annotations to JAX arrays (see e.g. #943)

@NeilGirdhar
Copy link
Contributor Author

NeilGirdhar commented Apr 16, 2021

@jakevdp Yeah, no worries. I figured it was a ways off. Should I close this issue in favor of #943? I don't want to drown you guys in issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants