Skip to content

Commit

Permalink
Add reason strings to FunctionGraph.replace calls
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonwillard committed Dec 2, 2022
1 parent 2b48015 commit f793027
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion aeppl/rewriting.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,6 @@ def construct_ir_fgraph(
new_to_old = tuple(
(v, k) for k, v in rv_remapper.measurable_conversions.items()
)
fgraph.replace_all(new_to_old)
fgraph.replace_all(new_to_old, reason="construct_ir_fgraph")

return fgraph, rv_values, memo
4 changes: 3 additions & 1 deletion aeppl/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,9 @@ def expand_replace(var: TensorVariable) -> List[TensorVariable]:
clone=False,
)

fg.replace_all(replacements.items(), import_missing=True)
fg.replace_all(
replacements.items(), import_missing=True, reason="replace_rvs_in_graphs"
)

graphs = list(fg.outputs)

Expand Down

0 comments on commit f793027

Please sign in to comment.