-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
New TypeError: <class 'function'> is not a valid JAX type
exception in JAX 0.2.0
#4416
Comments
Sorry for being slow to respond! It is intended. Not that we intended to break your code, of course! This error arises when the output of a jitted function is not a pytree of valid jax types, i.e. not a pytree of arrays (notice the We never intended to support returning non-jaxtype values (indeed the I say "work" in quotes because:
In 0.2.0 we stopped supporting that never-intended and opaque-bug-prone behavior. However, due to reason (1) above, in any case where this used to work, it shouldn't be too hard to revise the code not to return the function-valued arguments, since they were constants anyway and so didn't need to be returned from the jitted function. What do you think? |
Closing due to no response. Feel free to reopen if you want to add something! |
Thank you for your thorough explanation @mattjj ! There should be a section in the doc with all your answers in the issue tracker :) The issue was a quick fix indeed and everything is working now! |
TypeError: Argument 'cpu:0' of type <class 'jaxlib.xla_extension.CpuDevice'> is not a valid JAX type. I encountered this error while trying to run the below code. def match_faces3(desc): jax.device_put(descriptors,jax.devices()[0]) I tried everything but couldn't figure out the problem. Please help @mattjj |
I am working on a probabilistic programming library that makes heavy use of JAX. Since the release of the 0.2.0 version, JAX returns the following exception when executing the sampling code:
I downgraded to 0.1.77 and it runs fine. Is that intended? If so, is there a workaround?
Note that I have already run into this exception in the past, but never for this part of the code.
The text was updated successfully, but these errors were encountered: