Op selector
op_selector
OpSelector
Bases: NamedTuple
A specifier of an operation in a module. Useful when a stable reference is needed across copies of a module.
Source code in xdsl/utils/op_selector.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | |
idx: int
instance-attribute
The index of the operation in a module, when walking top to bottom as printed in the IR.
op_name: str
instance-attribute
The name of the expected operation, used to check that the op found is the expected one.
get_op(module_op: ModuleOp)
Returns the matching op, raising IndexError if the index is out of bounds and ValueError if the name does not match.
Source code in xdsl/utils/op_selector.py
27 28 29 30 31 32 33 34 35 36 37 38 39 | |