Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
arraycontext
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Andreas Klöckner
arraycontext
Commits
b2878758
Commit
b2878758
authored
1 year ago
by
Matthias Diener
Committed by
Andreas Klöckner
7 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Numpy actx: better freeze/thaw
parent
ee3100a1
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
arraycontext/impl/numpy/__init__.py
+10
-2
10 additions, 2 deletions
arraycontext/impl/numpy/__init__.py
with
10 additions
and
2 deletions
arraycontext/impl/numpy/__init__.py
+
10
−
2
View file @
b2878758
...
...
@@ -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
)
# }}}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment