DataflowBlock#
- class hugr.ops.DataflowBlock(inputs: list[~hugr.tys.Type], _sum: ~hugr.tys.Sum | None = None, _other_outputs: list[~hugr.tys.Type] | None = None, extension_delta: list[str] = <factory>)[source]#
Bases:
DfParentOp
Parent of non-entry basic block in a control flow graph.
Methods
Inner signature of the child dataflow graph.
Name of the operation.
The outputs passed to the nth successor of the block.
Get the kind of the given port.
Attributes
The number of output ports for this operation.
The non-branching outputs of the block which are passed to all successors.
If set, the sum type that defines the potential branching of the block.
Inputs types of the inner dataflow graph.
extension_delta
- inner_signature() FunctionType [source]#
Inner signature of the child dataflow graph.
- nth_outputs(n: int) list[Type] [source]#
The outputs passed to the nth successor of the block. Concatenation of the nth variant of the sum type and the other outputs.
- property num_out: int#
The number of output ports for this operation.
Example
>>> op = Const(val.TRUE) >>> op.num_out 1
- property other_outputs: list[Type]#
The non-branching outputs of the block which are passed to all successors.
- Raises:
IncompleteOp – If the outputs have not been set.
- port_kind(port: InPort | OutPort) ValueKind | ConstKind | FunctionKind | CFKind | OrderKind [source]#
Get the kind of the given port.
Example
>>> op = Const(val.TRUE) >>> op.port_kind(OutPort(Node(0), 0)) ConstKind(Bool)
- property sum_ty: Sum#
If set, the sum type that defines the potential branching of the block.
- Raises:
IncompleteOp – If the sum type has not been set.