Rate this Page

torch.fx.passes.graph_manipulation.replace_target_nodes_with#

torch.fx.passes.graph_manipulation.replace_target_nodes_with(fx_module, old_op, old_target, new_op, new_target)[source]#

Modifies all nodes in fx_module.graph.nodes which match the specified op code and target, and updates them to match the new op code and target.

Warning

This API is experimental and is NOT backward-compatible.