pytorch
b9d69104 - Update InternalMatch in subgraph_rewriter after repeated replacements (#99039)

Commit
1 year ago
Update InternalMatch in subgraph_rewriter after repeated replacements (#99039) Fixes #98974 When `torch.fx.subgraph_rewriter._replace_pattern` is used to remove nodes from a graph, if there are two adjacent matches then after the first removal, the nodes in `InternalMatch.nodes_map` and `placeholder_nodes` become outdated because they contain nodes that were just removed from the graph. This fix is to update the `match.nodes_map` and `match.placeholder_nodes` using the node changes stored in `match_changed_node`. Pull Request resolved: https://github.com/pytorch/pytorch/pull/99039 Approved by: https://github.com/angelayi
Author
Committer
Parents
Loading