How can we export the data generated during the calculation process in the model? #1975
-
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
This is not a netket-specific question, but rather a jax specific one. You should ask it other at https://github.com/jax-ml/jax . Regardless, the issue here is that you have a network and it is Jitted, so you cannot insert arbitrary functions. If you want to print the content of an array inside a jitted function, instead, you should not do jax.debug.print("my array {}", x) |
Beta Was this translation helpful? Give feedback.
This is not a netket-specific question, but rather a jax specific one. You should ask it other at https://github.com/jax-ml/jax .
This is a common question in jax.
Regardless, the issue here is that you have a network and it is Jitted, so you cannot insert arbitrary functions.
The solution would be to use a jax.pure_callback or more appropriately a jax.experimental.io_Callback if you want to save to file.
If you want to print the content of an array inside a jitted function, instead, you should not do
print(x)
but you should use jax.debug.print and do something like