We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 996f5e6 commit 405bb8bCopy full SHA for 405bb8b
1 file changed
meshmode/array_context.py
@@ -619,16 +619,14 @@ def transform_dag(self, dag):
619
# {{{ face_mass: materialize einsum args
620
621
def materialize_face_mass_vec(expr):
622
- if isinstance(expr, pt.Einsum):
623
- my_tag, = expr.tags_of_type(pt.tags.EinsumInfo)
624
- if my_tag.spec == "ifj,fej,fej->ei":
625
- mat, jac, vec = expr.args
626
- return pt.einsum("ifj,fej,fej->ei",
627
- mat,
628
- jac,
629
- vec.tagged(pt.tags.ImplStored()))
630
- else:
631
- return expr
+ if (isinstance(expr, pt.Einsum)
+ and pt.analysis.is_einsum_similar_to_subscript(
+ expr, "ifj,fej,fej->ei")):
+ mat, jac, vec = expr.args
+ return pt.einsum("ifj,fej,fej->ei",
+ mat,
+ jac,
+ vec.tagged(pt.tags.ImplStored()))
632
else:
633
return expr
634
0 commit comments