Skip to content
Discussion options

You must be logged in to vote

Thanks for the question! This is an intended departure from numpy's API: in most places JAX does not silently convert iterables to arrays, because this can hide performance issues.

If you'd like to append a tuple to an array, you can call jnp.asarray explicitly; e.g.

tup = (3, 4)
jnp.append(jnp.array([1, 2]), jnp.array(tup))

I think we should add a note about this to the Sharp Bits documentation.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@jakevdp
Comment options

@nikihowe
Comment options

Answer selected by nikihowe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants