Skip to content

[MLIR] [python] Fixed the signature of _OperationBase.get_asm #136676

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 23, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 19 additions & 12 deletions mlir/python/mlir/_mlir_libs/_mlir/ir.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,8 @@ from __future__ import annotations
import abc
import collections
from collections.abc import Callable, Sequence
import io
from pathlib import Path
from typing import Any, BinaryIO, ClassVar, TypeVar, overload
from typing import Any, BinaryIO, ClassVar, Literal, TypeVar, overload

__all__ = [
"AffineAddExpr",
Expand Down Expand Up @@ -196,6 +195,19 @@ class _OperationBase:
Detaches the operation from its parent block.
"""
def erase(self) -> None: ...

@overload
def get_asm(
binary: Literal[True],
large_elements_limit: int | None = None,
enable_debug_info: bool = False,
pretty_debug_info: bool = False,
print_generic_op_form: bool = False,
use_local_scope: bool = False,
assume_verified: bool = False,
skip_regions: bool = False,
) -> bytes: ...
@overload
def get_asm(
self,
binary: bool = False,
Expand All @@ -206,19 +218,14 @@ class _OperationBase:
use_local_scope: bool = False,
assume_verified: bool = False,
skip_regions: bool = False,
) -> io.BytesIO | io.StringIO:
) -> str:
"""
Gets the assembly form of the operation with all options available.
Returns the assembly form of the operation.

Args:
binary: Whether to return a bytes (True) or str (False) object. Defaults to
False.
... others ...: See the print() method for common keyword arguments for
configuring the printout.
Returns:
Either a bytes or str object, depending on the setting of the 'binary'
argument.
See the print() method for common keyword arguments for configuring
the output.
"""

def move_after(self, other: _OperationBase) -> None:
"""
Puts self immediately after the other operation in its parent block.
Expand Down
Loading