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
63ef9391
Commit
63ef9391
authored
2 years ago
by
Andreas Klöckner
Committed by
Andreas Klöckner
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Einsum array argument naming: Use NameHint
parent
1f7fff83
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
arraycontext/impl/pytato/__init__.py
+8
-8
8 additions, 8 deletions
arraycontext/impl/pytato/__init__.py
with
8 additions
and
8 deletions
arraycontext/impl/pytato/__init__.py
+
8
−
8
View file @
63ef9391
...
...
@@ -44,6 +44,8 @@ THE SOFTWARE.
from
arraycontext.context
import
ArrayContext
,
_ScalarLike
from
arraycontext.container.traversal
import
rec_map_array_container
from
arraycontext.metadata
import
NameHint
import
numpy
as
np
from
typing
import
Any
,
Callable
,
Union
,
TYPE_CHECKING
,
Tuple
,
Type
from
pytools.tag
import
ToTagSetConvertible
...
...
@@ -351,15 +353,14 @@ class PytatoPyOpenCLArrayContext(_BasePytatoArrayContext):
ary
=
arg
if
name
is
not
None
:
from
pytato.tags
import
PrefixNamed
# Tagging Placeholders with naming-related tags is pointless:
# They already have names. It's also counterproductive, as
# multiple placeholders with the same name that are not
# also the same object are not allowed, and this would produce
# a different Placeholder object of the same name.
if
not
isinstance
(
ary
,
pt
.
Placeholder
):
ary
=
ary
.
tagged
(
PrefixNamed
(
name
))
if
(
not
isinstance
(
ary
,
pt
.
Placeholder
)
and
not
ary
.
tags_of_type
(
NameHint
)):
ary
=
ary
.
tagged
(
NameHint
(
name
))
return
ary
...
...
@@ -492,15 +493,14 @@ class PytatoJAXArrayContext(_BasePytatoArrayContext):
ary
=
arg
if
name
is
not
None
:
from
pytato.tags
import
PrefixNamed
# Tagging Placeholders with naming-related tags is pointless:
# They already have names. It's also counterproductive, as
# multiple placeholders with the same name that are not
# also the same object are not allowed, and this would produce
# a different Placeholder object of the same name.
if
not
isinstance
(
ary
,
pt
.
Placeholder
):
ary
=
ary
.
tagged
(
PrefixNamed
(
name
))
if
(
not
isinstance
(
ary
,
pt
.
Placeholder
)
and
not
ary
.
tags_of_type
(
NameHint
)):
ary
=
ary
.
tagged
(
NameHint
(
name
))
return
ary
...
...
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