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

Incorrect indexing behavior when a numpy array is indexed with a jax.numpy array #2028

Closed
Sohl-Dickstein opened this issue Jan 20, 2020 · 1 comment

Comments

@Sohl-Dickstein
Copy link
Contributor

import numpy as onp
import jax.numpy as jnp 

oa = onp.zeros((7,3))
ob = onp.array([1,6])
ja = jnp.zeros((7,3))
jb = jnp.array([1,6])
print(oa[ob]) # works
print(ja[jb]) # works
print(ja[ob]) # works
print(oa[jb, :]) # works
print(oa[jb]) # throws an IndexError
@shoyer
Copy link
Collaborator

shoyer commented Jan 20, 2020

Yes, this is unfortunate. As far as we can tell, this is basically a NumPy bug (but at least should be automatically fixed once some deprecated behavior is removed). Let's keep discussion over in #620, though.

@shoyer shoyer closed this as completed Jan 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants