mlir.dialects.transform.interpreter

Attributes

Classes

Functions

_unpack_operation(op)

apply_named_sequence(payload_root, transform_root, ...)

Applies the transformation script starting at the given transform root

copy_symbols_and_merge_into(target, other)

Copies symbols from other into target, renaming private symbols to avoid

Package Contents

class mlir.dialects.transform.interpreter.Operation

Bases: _OperationBase

static create(name: str, results: collections.abc.Sequence[Type] | None = None, operands: collections.abc.Sequence[Value] | None = None, attributes: dict[str, Attribute] | None = None, successors: collections.abc.Sequence[Block] | None = None, regions: int = 0, loc: Location | None = None, ip: object | None = None, infer_type: bool = False) Operation

Creates a new operation.

Parameters:
  • name – Operation name (e.g. dialect.operation).

  • results – Optional sequence of Type representing op result types.

  • operands – Optional operands of the operation.

  • attributes – Optional Dict of {str: Attribute}.

  • successors – Optional List of Block for the operation’s successors.

  • regions – Number of regions to create (default = 0).

  • location – Optional Location object (defaults to resolve from context manager).

  • ip – Optional InsertionPoint (defaults to resolve from context manager or set to False to disable insertion, even with an insertion point set in the context manager).

  • infer_type – Whether to infer result types (default = False).

Returns:

A new detached Operation object. Detached operations can be added to blocks, which causes them to become attached.

static parse(source: str, *, source_name: str = '', context: Context | None = None) OpView

Parses an operation. Supports both text assembly format and binary bytecode format.

property _CAPIPtr: object

Gets a capsule wrapping the MlirOperation.

static _CAPICreate(arg: object, /) object

Creates an Operation from a capsule wrapping MlirOperation.

property operation: Operation

Returns self (the operation).

property opview: OpView

Returns an OpView of this operation.

Note: If the operation has a registered and loaded dialect then this OpView will be concrete wrapper class.

property block: Block

Returns the block containing this operation.

property successors: OpSuccessors

Returns the list of Operation successors.

replace_uses_of_with(of: Value, with_: Value) None

Replaces uses of the ‘of’ value with the ‘with’ value inside the operation.

_set_invalid() None

Invalidate the operation.

mlir.dialects.transform.interpreter.TransformOptions
mlir.dialects.transform.interpreter._unpack_operation(op)
mlir.dialects.transform.interpreter.apply_named_sequence(payload_root, transform_root, transform_module, transform_options=None)

Applies the transformation script starting at the given transform root operation to the given payload operation. The module containing the transform root as well as the transform options should be provided. The transform operation must implement TransformOpInterface and the module must be a ModuleOp.

mlir.dialects.transform.interpreter.copy_symbols_and_merge_into(target, other)

Copies symbols from other into target, renaming private symbols to avoid duplicates. Raises an error if copying would lead to duplicate public symbols.