From 8818204ad148f591dcf4383b01e332ca3d879167 Mon Sep 17 00:00:00 2001 From: Kaushik Kulkarni Date: Sun, 1 May 2022 12:55:12 -0500 Subject: [PATCH] to_numpy: thaw(freeze(...)) first --- arraycontext/container/traversal.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arraycontext/container/traversal.py b/arraycontext/container/traversal.py index 85877cc4..fc9fdffd 100644 --- a/arraycontext/container/traversal.py +++ b/arraycontext/container/traversal.py @@ -845,7 +845,10 @@ def _to_numpy_with_check(subary: Any) -> Any: f"array of type '{type(subary).__name__}' not in " f"supported types {actx.array_types}") - return rec_map_array_container(_to_numpy_with_check, ary) + return rec_map_array_container(_to_numpy_with_check, + # do a freeze first, if 'actx' supports + # container-wide freezes + thaw(freeze(ary, actx), actx)) # }}}