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

Method update_input_link

python/paddle/base/framework.py:5776–5796  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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 """

Callers 15

_transform_forwardMethod · 0.80
_transform_backwardMethod · 0.80
_insert_funcMethod · 0.80
applyMethod · 0.80
applyMethod · 0.80
applyMethod · 0.80
_transform_forwardMethod · 0.80
_transform_backwardMethod · 0.80
_quant_conv1dMethod · 0.80
applyMethod · 0.80

Calls 7

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

Tested by

no test coverage detected