Skip to content

Commit e060f1e

Browse files
EagerJAXArrayContext: return mutable numpy array in to_numpy
1 parent 0abca20 commit e060f1e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arraycontext/impl/jax/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ def _from_numpy(ary):
101101
def to_numpy(self, array):
102102
def _to_numpy(ary):
103103
import jax
104-
return jax.device_get(ary)
104+
return np.copy(jax.device_get(ary))
105105

106106
return with_array_context(
107107
self._rec_map_container(_to_numpy, array),

0 commit comments

Comments
 (0)