How to use xla_bridge_get_backend().live_arrays() #18337
-
Hi JAX community, Inspired by #18330, I tested
I got the output
which is good. But if I print the output again, I got
The arrays were doubled! Does anyone know what is going on here? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Please use When you say "print the output again": did you run the entire Jupyter cell again? Is it possible that Jupyter is keeping references to the first set of outputs? |
Beta Was this translation helpful? Give feedback.
I'm not sure how you're executing your code, but note that Jupyter notebooks store references to all cell outputs. So the fact that you wrote things like
x[-1] # refers to alpha
makes me think that you're displaying this in a cell output, which would maintain a reference to it. You can useprint(x[-1])
to avoid this.