ToNode#
- class hugr.hugr.node_port.ToNode(*args, **kwargs)[source]#
-
Protocol by any object that can be treated as a
Node
.Methods
Generate an input port for this node.
Generate an output port for this node.
OutPort corresponding to this
Wire
.Returns an iterator over the output ports of this node.
Generate a port in direction for this node with offset.
Convert to a
Node
.Attributes
Metadata associated with this node.
- inp(offset: int) InPort [source]#
Generate an input port for this node.
- Parameters:
offset – port offset.
- Returns:
Incoming port for this node.
Examples
>>> Node(0).inp(1) InPort(Node(0), 1)
- out(offset: int) OutPort [source]#
Generate an output port for this node.
- Parameters:
offset – port offset.
- Returns:
Outgoing port for this node.
Examples
>>> Node(0).out(1) OutPort(Node(0), 1)