Skip to content
Snippets Groups Projects
Commit b2878758 authored by Matthias Diener's avatar Matthias Diener Committed by Andreas Klöckner
Browse files

Numpy actx: better freeze/thaw

parent ee3100a1
No related branches found
No related tags found
No related merge requests found
......@@ -38,6 +38,8 @@ import loopy as lp
from pytools.tag import Tag
from arraycontext.context import ArrayContext
from arraycontext.container.traversal import (
rec_map_array_container, with_array_context)
class NumpyArrayContext(ArrayContext):
......@@ -91,10 +93,16 @@ class NumpyArrayContext(ArrayContext):
return result
def freeze(self, array):
return array
def _freeze(ary):
return ary
return with_array_context(rec_map_array_container(_freeze, array), actx=None)
def thaw(self, array):
return array
def _thaw(ary):
return ary
return with_array_context(rec_map_array_container(_thaw, array), actx=self)
# }}}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment