Skip to content

Commit

Permalink
Mapping an Einsum to the IndexLambda should use the appropriate varia…
Browse files Browse the repository at this point in the history
…ble names. (#534)
  • Loading branch information
nkoskelo authored Aug 6, 2024
1 parent c9d11e4 commit e05197b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pytato/transform/lower_to_index_lambda.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ def map_einsum(self, expr: Einsum) -> IndexLambda:
dim_to_index_lambda_components,
)

bindings = {f"in{k}": self.rec(arg) for k, arg in enumerate(expr.args)}
bindings = {f"_in{k}": self.rec(arg) for k, arg in enumerate(expr.args)}
redn_bounds: dict[str, tuple[ScalarExpression, ScalarExpression]] = {}
args_as_pym_expr: list[prim.Subscript] = []
namegen = UniqueNameGenerator(set(bindings))
Expand Down Expand Up @@ -253,7 +253,7 @@ def map_einsum(self, expr: Einsum) -> IndexLambda:

subscript_indices.append(prim.Variable(redn_idx_name))

args_as_pym_expr.append(prim.Subscript(prim.Variable(f"in{iarg}"),
args_as_pym_expr.append(prim.Subscript(prim.Variable(f"_in{iarg}"),
tuple(subscript_indices)))

# }}}
Expand Down

0 comments on commit e05197b

Please sign in to comment.