A few tweaks to the MLIR .pyi files (#110488)

This commit is contained in:
Sergei Lebedev
2024-10-01 12:49:18 +01:00
committed by GitHub
parent a88901838a
commit 91ef1f7caa
7 changed files with 197 additions and 211 deletions

View File

@@ -1,9 +1,8 @@
from typing import List
globals: "_Globals"
class _Globals:
dialect_search_modules: List[str]
dialect_search_modules: list[str]
def _register_dialect_impl(self, dialect_namespace: str, dialect_class: type) -> None: ...
def _register_operation_impl(self, operation_name: str, operation_class: type) -> None: ...
def append_dialect_search_prefix(self, module_name: str) -> None: ...

View File

@@ -2,7 +2,6 @@
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
from typing import Optional
from mlir.ir import Type, Context
@@ -26,7 +25,7 @@ class AttributeType(Type):
def isinstance(type: Type) -> bool: ...
@staticmethod
def get(context: Optional[Context] = None) -> AttributeType: ...
def get(context: Context | None = None) -> AttributeType: ...
class OperationType(Type):
@@ -34,7 +33,7 @@ class OperationType(Type):
def isinstance(type: Type) -> bool: ...
@staticmethod
def get(context: Optional[Context] = None) -> OperationType: ...
def get(context: Context | None = None) -> OperationType: ...
class RangeType(Type):
@@ -53,7 +52,7 @@ class TypeType(Type):
def isinstance(type: Type) -> bool: ...
@staticmethod
def get(context: Optional[Context] = None) -> TypeType: ...
def get(context: Context | None = None) -> TypeType: ...
class ValueType(Type):
@@ -61,4 +60,4 @@ class ValueType(Type):
def isinstance(type: Type) -> bool: ...
@staticmethod
def get(context: Optional[Context] = None) -> ValueType: ...
def get(context: Context | None = None) -> ValueType: ...

View File

@@ -2,7 +2,6 @@
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
from typing import List
from mlir.ir import Type
@@ -94,15 +93,15 @@ class UniformQuantizedPerAxisType(QuantizedType):
@classmethod
def get(cls, flags: int, storage_type: Type, expressed_type: Type,
scales: List[float], zero_points: List[int], quantized_dimension: int,
scales: list[float], zero_points: list[int], quantized_dimension: int,
storage_type_min: int, storage_type_max: int):
...
@property
def scales(self) -> List[float]: ...
def scales(self) -> list[float]: ...
@property
def zero_points(self) -> List[float]: ...
def zero_points(self) -> list[float]: ...
@property
def quantized_dimension(self) -> int: ...

View File

@@ -2,7 +2,6 @@
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
from typing import Optional
from mlir.ir import Type, Context
@@ -12,7 +11,7 @@ class AnyOpType(Type):
def isinstance(type: Type) -> bool: ...
@staticmethod
def get(context: Optional[Context] = None) -> AnyOpType: ...
def get(context: Context | None = None) -> AnyOpType: ...
class OperationType(Type):
@@ -20,7 +19,7 @@ class OperationType(Type):
def isinstance(type: Type) -> bool: ...
@staticmethod
def get(operation_name: str, context: Optional[Context] = None) -> OperationType: ...
def get(operation_name: str, context: Context | None = None) -> OperationType: ...
@property
def operation_name(self) -> str: ...

File diff suppressed because it is too large Load Diff

View File

@@ -4,7 +4,6 @@
# * Relative imports for cross-module references.
# * Add __all__
from typing import Any, Optional
from . import ir as _ir
@@ -13,7 +12,7 @@ __all__ = [
]
class PassManager:
def __init__(self, context: Optional[_ir.Context] = None) -> None: ...
def __init__(self, context: _ir.Context | None = None) -> None: ...
def _CAPICreate(self) -> object: ...
def _testing_release(self) -> None: ...
def enable_ir_printing(
@@ -26,7 +25,7 @@ class PassManager:
) -> None: ...
def enable_verifier(self, enable: bool) -> None: ...
@staticmethod
def parse(pipeline: str, context: Optional[_ir.Context] = None) -> PassManager: ...
def parse(pipeline: str, context: _ir.Context | None = None) -> PassManager: ...
def run(self, module: _ir._OperationBase) -> None: ...
@property
def _CAPIPtr(self) -> object: ...

View File

@@ -4,7 +4,7 @@
# * Relative imports for cross-module references.
# * Add __all__
from typing import List, Sequence
from collections.abc import Sequence
from ._mlir import ir as _ir