Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pymbolic
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
Model registry
Operate
Environments
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
Alexandru Fikl
pymbolic
Commits
7d58828a
Commit
7d58828a
authored
13 years ago
by
Andreas Klöckner
Browse files
Options
Downloads
Patches
Plain Diff
Fix wrap_in_cse() for specialized CSEs.
parent
05ab27d3
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
pymbolic/primitives.py
+8
-1
8 additions, 1 deletion
pymbolic/primitives.py
with
8 additions
and
1 deletion
pymbolic/primitives.py
+
8
−
1
View file @
7d58828a
...
...
@@ -686,6 +686,13 @@ class CommonSubexpression(Expression):
return
(
self
.
child
,
self
.
prefix
)
def
get_extra_properties
(
self
):
"""
Return a dictionary of extra kwargs to be passed to the
constructor from the identity mapper.
This allows derived classes to exist without having to
extend every mapper that processes them.
"""
return
{}
mapper_method
=
intern
(
"
map_common_subexpression
"
)
...
...
@@ -875,7 +882,7 @@ def wrap_in_cse(expr, prefix=None):
if
isinstance
(
expr
,
CommonSubexpression
):
if
prefix
is
None
:
return
expr
if
expr
.
prefix
is
None
:
if
expr
.
prefix
is
None
and
type
(
expr
)
is
CommonSubexpression
:
return
CommonSubexpression
(
expr
.
child
,
prefix
)
# existing prefix wins
...
...
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