Update the input's link of a operator node. Args: old_input_node(IrNode): the old input node of the giving op_node. new_input_node(IrNode): the new input node of the giving op_node. op_node(IrOpNode): the operator node that is needed to update in
(self, old_input_node, new_input_node, op_node)
| 5774 | return IrOpNode(self.graph.create_op_node(op_desc)) |
| 5775 | |
| 5776 | def update_input_link(self, old_input_node, new_input_node, op_node): |
| 5777 | """ |
| 5778 | Update the input's link of a operator node. |
| 5779 | |
| 5780 | Args: |
| 5781 | old_input_node(IrNode): the old input node of the giving op_node. |
| 5782 | new_input_node(IrNode): the new input node of the giving op_node. |
| 5783 | op_node(IrOpNode): the operator node that is needed to update input's link. |
| 5784 | """ |
| 5785 | assert ( |
| 5786 | old_input_node.node in self.graph.nodes() |
| 5787 | and new_input_node.node in self.graph.nodes() |
| 5788 | and op_node.node in self.graph.nodes() |
| 5789 | ), ( |
| 5790 | "The three arguments(old_input_node&new_input_node&op_node) must be in the graph nodes." |
| 5791 | ) |
| 5792 | old_input_node.remove_output(op_node) |
| 5793 | op_node.remove_input(old_input_node) |
| 5794 | new_input_node.append_output(op_node) |
| 5795 | op_node.append_input(new_input_node) |
| 5796 | op_node.rename_input(old_input_node.name(), new_input_node.name()) |
| 5797 | |
| 5798 | def update_output_link(self, old_output_node, new_output_node, op_node): |
| 5799 | """ |
no test coverage detected