Skip to content

How to add new variables to a Jaxpr? #28976

Answered by dfm
huterguier asked this question in Q&A
Discussion options

You must be logged in to vote

YMMV because the Jaxpr data structure isn't really meant to be user-facing, but I don't believe you need to specify an id. Variables in a Jaxpr are Var objects and they only wrap a AbstractValue:

new_var = Var("", ShapedArray((1, 5), jnp.float32))

should be fine for creating a new variable!

Replies: 1 comment 1 reply

Comment options

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

Answer selected by huterguier
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