MCPcopy Create free account
hub / github.com/PaddlePaddle/Paddle / update_output_link

Method update_output_link

python/paddle/base/framework.py:5798–5818  ·  view source on GitHub ↗

Update the output's link of an operator node. Args: old_output_node(IrNode): the old output node of the giving op_node. new_output_node(IrNode): the new output node of the giving op_node. op_node(IrOpNode): the operator node that is needed to upd

(self, old_output_node, new_output_node, op_node)

Source from the content-addressed store, hash-verified

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 """
5800 Update the output's link of an operator node.
5801
5802 Args:
5803 old_output_node(IrNode): the old output node of the giving op_node.
5804 new_output_node(IrNode): the new output node of the giving op_node.
5805 op_node(IrOpNode): the operator node that is needed to update input's link.
5806 """
5807 assert (
5808 old_output_node.node in self.graph.nodes()
5809 and new_output_node.node in self.graph.nodes()
5810 and op_node.node in self.graph.nodes()
5811 ), (
5812 "The three arguments(old_output_node &new_output_node &op_node) must be in the graph nodes."
5813 )
5814 old_output_node.remove_input(op_node)
5815 op_node.remove_output(old_output_node)
5816 new_output_node.append_input(op_node)
5817 op_node.append_output(new_output_node)
5818 op_node.rename_output(old_output_node.name(), new_output_node.name())
5819
5820 def link_to(self, node_in, node_out):
5821 """

Callers 1

_insert_funcMethod · 0.80

Calls 7

remove_inputMethod · 0.80
remove_outputMethod · 0.80
append_inputMethod · 0.80
append_outputMethod · 0.80
nodesMethod · 0.45
rename_outputMethod · 0.45
nameMethod · 0.45

Tested by

no test coverage detected