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

Class IrOpNode

python/paddle/base/framework.py:5421–5580  ·  view source on GitHub ↗

Python IrOpNode. Beneath it is a core.Node, it inherits from IrNode.

Source from the content-addressed store, hash-verified

5419
5420
5421class IrOpNode(IrNode):
5422 """
5423 Python IrOpNode. Beneath it is a core.Node, it inherits from IrNode.
5424 """
5425
5426 def __init__(self, node):
5427 """
5428 Construct an IrOpNode using core.Node.
5429
5430 Args:
5431 node(core.Node): C++ Node.
5432 """
5433 assert isinstance(node, core.Node) and node.is_op(), (
5434 "node must be the instance of core.Node and it must be a operator node."
5435 )
5436 super().__init__(node)
5437 self.node = node
5438
5439 def rename_input(self, old_input_name, new_input_name):
5440 """
5441 Rename the input of this node.
5442
5443 Args:
5444 old_input_name(str): the old input name.
5445 new_input_name(str): the new input name.
5446 """
5447 assert self.node.op() is not None, (
5448 "The node operator description can not be None."
5449 )
5450 self.node.op()._rename_input(old_input_name, new_input_name)
5451
5452 def rename_output(self, old_output_name, new_output_name):
5453 """
5454 Rename the output of this node.
5455
5456 Args:
5457 old_output_name(str): the old output name.
5458 new_output_name(str): the new output name.
5459 """
5460 assert self.node.op() is not None, (
5461 "The node operator description can not be None."
5462 )
5463 self.node.op()._rename_output(old_output_name, new_output_name)
5464
5465 def input(self, name):
5466 """
5467 Get the argument name list by the parameter name for input.
5468
5469 Args:
5470 name(str): the parameter name.
5471
5472 Returns:
5473 list(str): the argument name list.
5474 """
5475 assert self.node.op() is not None, (
5476 "The node operator description can not be None."
5477 )
5478 return self.node.op().input(name)

Callers 5

inputsMethod · 0.85
outputsMethod · 0.85
all_op_nodesMethod · 0.85
create_op_nodeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected