Skip to content

Graph replace: Handle redundant replacements#1942

Merged
ricardoV94 merged 2 commits intopymc-devs:v3from
ricardoV94:graph_replace_bug
Mar 6, 2026
Merged

Graph replace: Handle redundant replacements#1942
ricardoV94 merged 2 commits intopymc-devs:v3from
ricardoV94:graph_replace_bug

Conversation

@ricardoV94
Copy link
Member

@ricardoV94 ricardoV94 commented Mar 6, 2026

No reason to crash, the replacements are logically correct


def toposort_key(
fg: FunctionGraph, ts: list[Apply], pair: tuple[Variable, Variable]
pair: tuple[Variable, Variable],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any reason to re-order the inputs?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got rid of the functools.partial

@ricardoV94 ricardoV94 merged commit ba5336f into pymc-devs:v3 Mar 6, 2026
66 checks passed
@ricardoV94 ricardoV94 deleted the graph_replace_bug branch March 6, 2026 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants