jax icon indicating copy to clipboard operation
jax copied to clipboard

Make PyTreeDef jittable

Open timdhondt1 opened this issue 5 years ago • 0 comments

In working with Bayesian Neural Networks, I sample a d-dimensional vector, which is then unflattened into a PyTree using PyTreeDef argument that can be used with i.e the stax library. Because this functionality is often part of the loss function and calculating the gradient, it would speed up the training process if one can jit the entire loss function. This is currently not possible because PyTreeDef is not a valid JAX type.

Request

Make function arguments of type jaxlib.xla_extension.PyTreeDef jittable such that unflattening PyTrees can be sped up and part of jitted functions.

timdhondt1 avatar Oct 04 '21 08:10 timdhondt1