Model parameters end up as constants in the IR when exporting to stable-hlo #3271
Answered
by
cgarciae
navdeepkk-polymagelabs
asked this question in
Q&A
-
I tried exporting ResNet from Google Scenic (https://github.com/google-research/scenic) library to stable hlo. This lowering captured all the model parameters as constants. Is there a way to capture the model parameters as the function arguments rather than constants? I am using the following
Thanks! |
Beta Was this translation helpful? Give feedback.
Answered by
cgarciae
Aug 17, 2023
Replies: 1 comment 1 reply
-
Hey @navdeepkk-polymagelabs, you will have to give a bit more context. Its not clear what def forward(params, x):
return model.apply({'params': params, x)
mlir_stable_hlo = jax.jit(forward).lower(params, x).as_text() |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
navdeepkk-polymagelabs
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey @navdeepkk-polymagelabs, you will have to give a bit more context. Its not clear what
model
is here in this case. Usually you create a "forward" function or similar and lower that: