Skip to content

How to unflatten a PyTree one level? #28133

Answered by jakevdp
adonath asked this question in General
Discussion options

You must be logged in to vote

You can do this:

jax.tree.flatten(x, is_leaf = lambda node: node is not x)

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@adonath
Comment options

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