Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove calls to Einsum.__init__ #4

Merged
merged 1 commit into from
Jan 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 4 additions & 13 deletions meshmode/array_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -1376,12 +1376,7 @@ def materialize_inverse_mass_inputs(expr):
if not arg3.tags_of_type(pt.tags.ImplStored):
arg3 = arg3.tagged(pt.tags.ImplStored())

return pt.Einsum(expr.access_descriptors,
(arg1, arg2, arg3),
expr.redn_axis_to_redn_descr,
expr.index_to_access_descr,
axes=expr.axes,
tags=expr.tags)
return expr.copy(args=(arg1, arg2, arg3))
else:
return expr

Expand Down Expand Up @@ -1495,13 +1490,9 @@ def _get_rid_of_broadcasts_from_einsum(expr):
new_args.append(arg)
new_access_descriptors.append(tuple(new_access_descrs))

return pt.Einsum(tuple(new_access_descriptors),
tuple(new_args),
tags=expr.tags,
axes=expr.axes,
redn_axis_to_redn_descr=(expr
.redn_axis_to_redn_descr),
index_to_access_descr=expr.index_to_access_descr)
return expr.copy(
access_descriptors=tuple(new_access_descriptors),
args=tuple(new_args))
else:
return expr

Expand Down
Loading