1# Originally imported via: 2# stubgen {...} -m mlir._mlir_libs._mlir.ir 3# Local modifications: 4# * Rewrite references to 'mlir.ir.' to local types 5# * Add __all__ with the following incantation: 6# egrep '^class ' ir.pyi | awk -F ' |:|\\(' '{print " \"" $2 "\","}' 7# * Local edits to signatures and types that MyPy did not auto detect (or 8# detected incorrectly). 9 10from typing import ( 11 Any, Callable, ClassVar, Dict, List, Optional, Sequence, Tuple, 12 Type as _Type, TypeVar 13) 14 15from typing import overload 16 17__all__ = [ 18 "AffineAddExpr", 19 "AffineBinaryExpr", 20 "AffineCeilDivExpr", 21 "AffineConstantExpr", 22 "AffineDimExpr", 23 "AffineExpr", 24 "AffineExprList", 25 "AffineFloorDivExpr", 26 "AffineMap", 27 "AffineMapAttr", 28 "AffineModExpr", 29 "AffineMulExpr", 30 "AffineSymbolExpr", 31 "ArrayAttr", 32 "ArrayAttributeIterator", 33 "Attribute", 34 "BF16Type", 35 "Block", 36 "BlockArgument", 37 "BlockArgumentList", 38 "BlockIterator", 39 "BlockList", 40 "BoolAttr", 41 "ComplexType", 42 "Context", 43 "DenseElementsAttr", 44 "DenseFPElementsAttr", 45 "DenseIntElementsAttr", 46 "Dialect", 47 "DialectDescriptor", 48 "Dialects", 49 "Diagnostic", 50 "DiagnosticHandler", 51 "DiagnosticSeverity", 52 "DictAttr", 53 "F16Type", 54 "F32Type", 55 "F64Type", 56 "FlatSymbolRefAttr", 57 "FloatAttr", 58 "FunctionType", 59 "IndexType", 60 "InferTypeOpInterface", 61 "InsertionPoint", 62 "IntegerAttr", 63 "IntegerSet", 64 "IntegerSetConstraint", 65 "IntegerSetConstraintList", 66 "IntegerType", 67 "Location", 68 "MemRefType", 69 "Module", 70 "NamedAttribute", 71 "NoneType", 72 "OpaqueType", 73 "OpAttributeMap", 74 "OpOperandList", 75 "OpResult", 76 "OpResultList", 77 "OpView", 78 "Operation", 79 "OperationIterator", 80 "OperationList", 81 "RankedTensorType", 82 "Region", 83 "RegionIterator", 84 "RegionSequence", 85 "ShapedType", 86 "StringAttr", 87 "SymbolTable", 88 "TupleType", 89 "Type", 90 "TypeAttr", 91 "UnitAttr", 92 "UnrankedMemRefType", 93 "UnrankedTensorType", 94 "Value", 95 "VectorType", 96 "_GlobalDebug", 97 "_OperationBase", 98] 99 100# Base classes: declared first to simplify declarations below. 101class _OperationBase: 102 def detach_from_parent(self) -> OpView: ... 103 def get_asm(self, binary: bool = False, large_elements_limit: Optional[int] = 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) -> object: ... 104 def move_after(self, other: _OperationBase) -> None: ... 105 def move_before(self, other: _OperationBase) -> None: ... 106 def print(self, file: Optional[Any] = None, binary: bool = False, large_elements_limit: Optional[int] = 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) -> None: ... 107 def verify(self) -> bool: ... 108 @overload 109 def __eq__(self, arg0: _OperationBase) -> bool: ... 110 @overload 111 def __eq__(self, arg0: object) -> bool: ... 112 def __hash__(self) -> int: ... 113 @property 114 def _CAPIPtr(self) -> object: ... 115 @property 116 def attributes(self) -> OpAttributeMap: ... 117 @property 118 def location(self) -> Location: ... 119 @property 120 def operands(self) -> OpOperandList: ... 121 @property 122 def regions(self) -> RegionSequence: ... 123 @property 124 def result(self) -> OpResult: ... 125 @property 126 def results(self) -> OpResultList: ... 127 128_TOperation = TypeVar("_TOperation", bound=_OperationBase) 129 130# TODO: Auto-generated. Audit and fix. 131class AffineExpr: 132 def __init__(self, *args, **kwargs) -> None: ... 133 def _CAPICreate(self) -> AffineExpr: ... 134 def compose(self, arg0) -> AffineExpr: ... 135 def dump(self) -> None: ... 136 def get_add(self, *args, **kwargs) -> Any: ... 137 def get_ceil_div(self, *args, **kwargs) -> Any: ... 138 def get_constant(self, *args, **kwargs) -> Any: ... 139 def get_dim(self, *args, **kwargs) -> Any: ... 140 def get_floor_div(self, *args, **kwargs) -> Any: ... 141 def get_mod(self, *args, **kwargs) -> Any: ... 142 def get_mul(self, *args, **kwargs) -> Any: ... 143 def get_symbol(self, *args, **kwargs) -> Any: ... 144 def __add__(self, other) -> Any: ... 145 @overload 146 def __eq__(self, arg0: AffineExpr) -> bool: ... 147 @overload 148 def __eq__(self, arg0: object) -> bool: ... 149 def __hash__(self) -> int: ... 150 def __mod__(self, other) -> Any: ... 151 def __mul__(self, other) -> Any: ... 152 def __radd__(self, other) -> Any: ... 153 def __rmod__(self, other) -> Any: ... 154 def __rmul__(self, other) -> Any: ... 155 def __rsub__(self, other) -> Any: ... 156 def __sub__(self, other) -> Any: ... 157 @property 158 def _CAPIPtr(self) -> object: ... 159 @property 160 def context(self) -> Context: ... 161 162class Attribute: 163 def __init__(self, cast_from_type: Attribute) -> None: ... 164 def _CAPICreate(self) -> Attribute: ... 165 def dump(self) -> None: ... 166 def get_named(self, *args, **kwargs) -> Any: ... 167 @staticmethod 168 def parse(asm: str, context: Optional[Context] = None) -> Any: ... 169 @overload 170 def __eq__(self, arg0: Attribute) -> bool: ... 171 @overload 172 def __eq__(self, arg0: object) -> bool: ... 173 def __hash__(self) -> int: ... 174 @property 175 def _CAPIPtr(self) -> object: ... 176 @property 177 def context(self) -> Context: ... 178 @property 179 def type(self) -> Type: ... 180 181class Type: 182 def __init__(self, cast_from_type: Type) -> None: ... 183 def _CAPICreate(self) -> Type: ... 184 def dump(self) -> None: ... 185 @staticmethod 186 def parse(asm: str, context: Optional[Context] = None) -> Type: ... 187 @overload 188 def __eq__(self, arg0: Type) -> bool: ... 189 @overload 190 def __eq__(self, arg0: object) -> bool: ... 191 def __hash__(self) -> int: ... 192 @property 193 def _CAPIPtr(self) -> object: ... 194 @property 195 def context(self) -> Context: ... 196 197class Value: 198 def _CAPICreate(self) -> Value: ... 199 def dump(self) -> None: ... 200 @overload 201 def __eq__(self, arg0: Value) -> bool: ... 202 @overload 203 def __eq__(self, arg0: object) -> bool: ... 204 def __hash__(self) -> int: ... 205 @property 206 def _CAPIPtr(self) -> object: ... 207 @property 208 def context(self) -> Context: ... 209 @property 210 def owner(self) -> _OperationBase: ... 211 @property 212 def type(self) -> Type: ... 213 214 215# Classes with no particular order sensitivity in alpha order. 216# TODO: Auto-generated. Audit and fix. 217class AffineAddExpr(AffineBinaryExpr): 218 def __init__(self, expr: AffineExpr) -> None: ... 219 @staticmethod 220 def get(*args, **kwargs) -> AffineAddExpr: ... 221 @staticmethod 222 def isinstance(arg: Any) -> bool: ... 223 224# TODO: Auto-generated. Audit and fix. 225class AffineBinaryExpr(AffineExpr): 226 def __init__(self, expr: AffineExpr) -> None: ... 227 @staticmethod 228 def isinstance(arg: Any) -> bool: ... 229 @property 230 def lhs(self) -> AffineExpr: ... 231 @property 232 def rhs(self) -> AffineExpr: ... 233 234# TODO: Auto-generated. Audit and fix. 235class AffineCeilDivExpr(AffineBinaryExpr): 236 def __init__(self, expr: AffineExpr) -> None: ... 237 @staticmethod 238 def get(*args, **kwargs) -> AffineCeilDivExpr: ... 239 @staticmethod 240 def isinstance(arg: Any) -> bool: ... 241 242# TODO: Auto-generated. Audit and fix. 243class AffineConstantExpr(AffineExpr): 244 def __init__(self, expr: AffineExpr) -> None: ... 245 @staticmethod 246 def get(*args, **kwargs) -> AffineConstantExpr: ... 247 @staticmethod 248 def isinstance(arg: Any) -> bool: ... 249 @property 250 def value(self) -> int: ... 251 252# TODO: Auto-generated. Audit and fix. 253class AffineDimExpr(AffineExpr): 254 def __init__(self, expr: AffineExpr) -> None: ... 255 @staticmethod 256 def get(*args, **kwargs) -> AffineDimExpr: ... 257 @staticmethod 258 def isinstance(arg: Any) -> bool: ... 259 @property 260 def position(self) -> int: ... 261 262# TODO: Auto-generated. Audit and fix. 263class AffineExprList: 264 def __init__(self, *args, **kwargs) -> None: ... 265 def __add__(self, arg0: AffineExprList) -> List[AffineExpr]: ... 266 @overload 267 def __getitem__(self, arg0: int) -> AffineExpr: ... 268 @overload 269 def __getitem__(self, arg0: slice) -> AffineExprList: ... 270 def __len__(self) -> int: ... 271 272# TODO: Auto-generated. Audit and fix. 273class AffineFloorDivExpr(AffineBinaryExpr): 274 def __init__(self, expr: AffineExpr) -> None: ... 275 def get(*args, **kwargs) -> AffineFloorDivExpr: ... 276 @staticmethod 277 def isinstance(arg: Any) -> bool: ... 278 279# TODO: Auto-generated. Audit and fix. 280class AffineMap: 281 def __init__(self, *args, **kwargs) -> None: ... 282 def _CAPICreate(self) -> AffineMap: ... 283 @staticmethod 284 def compress_unused_symbols(*args, **kwargs) -> Any: ... 285 def dump(self) -> None: ... 286 @staticmethod 287 def get(*args, **kwargs) -> AffineMap: ... 288 @staticmethod 289 def get_constant(*args, **kwargs) -> AffineMap: ... 290 @staticmethod 291 def get_empty(*args, **kwargs) -> AffineMap: ... 292 @staticmethod 293 def get_identity(*args, **kwargs) -> AffineMap: ... 294 @staticmethod 295 def get_minor_identity(*args, **kwargs) -> AffineMap: ... 296 def get_minor_submap(self, n_results: int) -> AffineMap: ... 297 def get_major_submap(self, n_results: int) -> AffineMap: ... 298 def get_permutation(self, *args, **kwargs) -> Any: ... 299 def get_submap(self, result_positions: List[int]) -> AffineMap: ... 300 def replace(self, expr: AffineExpr, replacement: AffineExpr, n_result_dims: int, n_result_syms: int) -> AffineMap: ... 301 @overload 302 def __eq__(self, arg0: AffineMap) -> bool: ... 303 @overload 304 def __eq__(self, arg0: object) -> bool: ... 305 def __hash__(self) -> int: ... 306 @property 307 def _CAPIPtr(self) -> object: ... 308 @property 309 def context(self) -> Context: ... 310 @property 311 def is_permutation(self) -> bool: ... 312 @property 313 def is_projected_permutation(self) -> bool: ... 314 @property 315 def n_dims(self) -> int: ... 316 @property 317 def n_inputs(self) -> int: ... 318 @property 319 def n_symbols(self) -> int: ... 320 @property 321 def results(self) -> Any: ... 322 323# TODO: Auto-generated. Audit and fix. 324class AffineMapAttr(Attribute): 325 def __init__(self, cast_from_attr: Attribute) -> None: ... 326 @staticmethod 327 def get(*args, **kwargs) -> AffineMapAttr: ... 328 @staticmethod 329 def isinstance(arg: Any) -> bool: ... 330 @property 331 def type(self) -> Type: ... 332 333# TODO: Auto-generated. Audit and fix. 334class AffineModExpr(AffineBinaryExpr): 335 def __init__(self, expr: AffineExpr) -> None: ... 336 @staticmethod 337 def get(*args, **kwargs) -> AffineModExpr: ... 338 @staticmethod 339 def isinstance(arg: Any) -> bool: ... 340 341# TODO: Auto-generated. Audit and fix. 342class AffineMulExpr(AffineBinaryExpr): 343 def __init__(self, expr: AffineExpr) -> None: ... 344 @staticmethod 345 def get(*args, **kwargs) -> AffineMulExpr: ... 346 @staticmethod 347 def isinstance(arg: Any) -> bool: ... 348 349# TODO: Auto-generated. Audit and fix. 350class AffineSymbolExpr(AffineExpr): 351 def __init__(self, expr: AffineExpr) -> None: ... 352 @staticmethod 353 def get(*args, **kwargs) -> AffineSymbolExpr: ... 354 @staticmethod 355 def isinstance(arg: Any) -> bool: ... 356 @property 357 def position(self) -> int: ... 358 359# TODO: Auto-generated. Audit and fix. 360class ArrayAttr(Attribute): 361 def __init__(self, cast_from_attr: Attribute) -> None: ... 362 @staticmethod 363 def get(*args, **kwargs) -> ArrayAttr: ... 364 @staticmethod 365 def isinstance(arg: Any) -> bool: ... 366 def __add__(self, arg0: list) -> ArrayAttr: ... 367 def __getitem__(self, arg0: int) -> Attribute: ... 368 def __iter__(self) -> Any: ... 369 def __len__(self) -> int: ... 370 @property 371 def type(self) -> Type: ... 372 373# TODO: Auto-generated. Audit and fix. 374class ArrayAttributeIterator: 375 def __init__(self, *args, **kwargs) -> None: ... 376 def __iter__(self) -> ArrayAttributeIterator: ... 377 def __next__(self) -> Attribute: ... 378 379# TODO: Auto-generated. Audit and fix. 380class BF16Type(Type): 381 def __init__(self, cast_from_type: Type) -> None: ... 382 @staticmethod 383 def get(*args, **kwargs) -> BF16Type: ... 384 @staticmethod 385 def isinstance(arg: Any) -> bool: ... 386 387class Block: 388 __hash__: ClassVar[None] = ... # type: ignore 389 def append(self, operation: _OperationBase) -> None: ... 390 def create_after(self, *args: Type) -> Block: ... 391 @staticmethod 392 def create_at_start(parent: Region, arg_types: List[Type]) -> Block: ... 393 def create_before(self, *args: Type) -> Block: ... 394 @overload 395 def __eq__(self, arg0: Block) -> bool: ... 396 @overload 397 def __eq__(self, arg0: object) -> bool: ... 398 def __iter__(self) -> Any: ... 399 @property 400 def arguments(self) -> BlockArgumentList: ... 401 @property 402 def operations(self) -> OperationList: ... 403 @property 404 def owner(self) -> OpView: ... 405 @property 406 def region(self) -> Region: ... 407 408class BlockArgument(Value): 409 @staticmethod 410 def isinstance(arg: Any) -> bool: ... 411 def set_type(self, type: Type) -> None: ... 412 @property 413 def arg_number(self) -> int: ... 414 @property 415 def owner(self) -> Block: ... # type: ignore[override] 416 417class BlockArgumentList: 418 def __add__(self, arg0: BlockArgumentList) -> List[BlockArgument]: ... 419 @overload 420 def __getitem__(self, arg0: int) -> BlockArgument: ... 421 @overload 422 def __getitem__(self, arg0: slice) -> BlockArgumentList: ... 423 def __len__(self) -> int: ... 424 @property 425 def types(self) -> List[Type]: ... 426 427class BlockIterator: 428 def __init__(self, *args, **kwargs) -> None: ... 429 def __iter__(self) -> BlockIterator: ... 430 def __next__(self) -> Block: ... 431 432class BlockList: 433 def append(self, *args) -> Block: ... 434 def __getitem__(self, arg0: int) -> Block: ... 435 def __iter__(self) -> BlockIterator: ... 436 def __len__(self) -> int: ... 437 438# TODO: Auto-generated. Audit and fix. 439class BoolAttr(Attribute): 440 def __init__(self, cast_from_attr: Attribute) -> None: ... 441 @staticmethod 442 def get(*args, **kwargs) -> BoolAttr: ... 443 @staticmethod 444 def isinstance(arg: Any) -> bool: ... 445 @property 446 def type(self) -> Type: ... 447 @property 448 def value(self) -> bool: ... 449 450# TODO: Auto-generated. Audit and fix. 451class ComplexType(Type): 452 def __init__(self, cast_from_type: Type) -> None: ... 453 @staticmethod 454 def get(*args, **kwargs) -> ComplexType: ... 455 @staticmethod 456 def isinstance(arg: Any) -> bool: ... 457 @property 458 def element_type(self) -> Type: ... 459 460class Context: 461 current: ClassVar[Context] = ... # read-only 462 allow_unregistered_dialects: bool 463 def __init__(self) -> None: ... 464 def _CAPICreate(self) -> object: ... 465 def _get_context_again(self) -> Context: ... 466 @staticmethod 467 def _get_live_count() -> int: ... 468 def _get_live_module_count(self) -> int: ... 469 def _get_live_operation_count(self) -> int: ... 470 def attach_diagnostic_handler(self, callback: Callable[[Diagnostic], bool]) -> DiagnosticHandler: ... 471 def enable_multithreading(self, enable: bool) -> None: ... 472 def get_dialect_descriptor(self, dialect_name: str) -> DialectDescriptor: ... 473 def is_registered_operation(self, operation_name: str) -> bool: ... 474 def __enter__(self) -> Context: ... 475 def __exit__(self, arg0: object, arg1: object, arg2: object) -> None: ... 476 @property 477 def _CAPIPtr(self) -> object: ... 478 @property 479 def d(self) -> Dialects: ... 480 @property 481 def dialects(self) -> Dialects: ... 482 def append_dialect_registry(self, registry: "DialectRegistry") -> None: ... 483 def load_all_available_dialects(self) -> None: ... 484 485class DialectRegistry: 486 def __init__(self) -> None: ... 487 488# TODO: Auto-generated. Audit and fix. 489class DenseElementsAttr(Attribute): 490 def __init__(self, cast_from_attr: Attribute) -> None: ... 491 @staticmethod 492 def get(*args, **kwargs) -> DenseElementsAttr: ... 493 @staticmethod 494 def get_splat(*args, **kwargs) -> Any: ... 495 @staticmethod 496 def isinstance(arg: Any) -> bool: ... 497 def __len__(self) -> int: ... 498 @property 499 def is_splat(self) -> bool: ... 500 @property 501 def type(self) -> Type: ... 502 503# TODO: Auto-generated. Audit and fix. 504class DenseFPElementsAttr(DenseElementsAttr): 505 def __init__(self, cast_from_attr: Attribute) -> None: ... 506 @staticmethod 507 def get(*args, **kwargs) -> DenseFPElementsAttr: ... 508 @staticmethod 509 def isinstance(arg: Any) -> bool: ... 510 def __getitem__(self, arg0: int) -> float: ... 511 @property 512 def type(self) -> Type: ... 513 514# TODO: Auto-generated. Audit and fix. 515class DenseIntElementsAttr(DenseElementsAttr): 516 def __init__(self, cast_from_attr: Attribute) -> None: ... 517 @staticmethod 518 def get(*args, **kwargs) -> DenseIntElementsAttr: ... 519 @staticmethod 520 def isinstance(arg: Any) -> bool: ... 521 def __getitem__(self, arg0: int) -> int: ... 522 @property 523 def type(self) -> Type: ... 524 525class Dialect: 526 def __init__(self, descriptor: DialectDescriptor) -> None: ... 527 @property 528 def descriptor(self) -> DialectDescriptor: ... 529 530class DialectDescriptor: 531 @property 532 def namespace(self) -> str: ... 533 534class Dialects: 535 def __init__(self, *args, **kwargs) -> None: ... 536 def __getattr__(self, arg0: str) -> Dialect: ... 537 def __getitem__(self, arg0: str) -> Dialect: ... 538 539class Diagnostic: 540 @property 541 def severity(self) -> DiagnosticSeverity: ... 542 @property 543 def location(self) -> Location: ... 544 @property 545 def message(self) -> str: ... 546 @property 547 def notes(self) -> Tuple[Diagnostic]: ... 548 549class DiagnosticHandler: 550 def detach(self) -> None: ... 551 @property 552 def attached(self) -> bool: ... 553 @property 554 def had_error(self) -> bool: ... 555 def __enter__(self) -> DiagnosticHandler: ... 556 def __exit__(self, arg0: object, arg1: object, arg2: object) -> None: ... 557 558class DiagnosticSeverity: 559 ERROR: DiagnosticSeverity 560 WARNING: DiagnosticSeverity 561 NOTE: DiagnosticSeverity 562 REMARK: DiagnosticSeverity 563 564# TODO: Auto-generated. Audit and fix. 565class DictAttr(Attribute): 566 def __init__(self, cast_from_attr: Attribute) -> None: ... 567 @staticmethod 568 def get(*args, **kwargs) -> DictAttr: ... 569 @staticmethod 570 def isinstance(arg: Any) -> bool: ... 571 def __contains__(self, arg0: str) -> bool: ... 572 @overload 573 def __getitem__(self, arg0: str) -> Attribute: ... 574 @overload 575 def __getitem__(self, arg0: int) -> NamedAttribute: ... 576 def __len__(self) -> int: ... 577 @property 578 def type(self) -> Type: ... 579 580# TODO: Auto-generated. Audit and fix. 581class F16Type(Type): 582 def __init__(self, cast_from_type: Type) -> None: ... 583 @staticmethod 584 def get(*args, **kwargs) -> F16Type: ... 585 @staticmethod 586 def isinstance(arg: Any) -> bool: ... 587 588# TODO: Auto-generated. Audit and fix. 589class F32Type(Type): 590 def __init__(self, cast_from_type: Type) -> None: ... 591 @staticmethod 592 def get(*args, **kwargs) -> F32Type: ... 593 @staticmethod 594 def isinstance(arg: Any) -> bool: ... 595 596# TODO: Auto-generated. Audit and fix. 597class F64Type(Type): 598 def __init__(self, cast_from_type: Type) -> None: ... 599 @staticmethod 600 def get(*args, **kwargs) -> F64Type: ... 601 @staticmethod 602 def isinstance(arg: Any) -> bool: ... 603 604# TODO: Auto-generated. Audit and fix. 605class FlatSymbolRefAttr(Attribute): 606 def __init__(self, cast_from_attr: Attribute) -> None: ... 607 @staticmethod 608 def get(*args, **kwargs) -> FlatSymbolRefAttr: ... 609 @staticmethod 610 def isinstance(arg: Any) -> bool: ... 611 @property 612 def type(self) -> Type: ... 613 @property 614 def value(self) -> str: ... 615 616# TODO: Auto-generated. Audit and fix. 617class FloatAttr(Attribute): 618 def __init__(self, cast_from_attr: Attribute) -> None: ... 619 @staticmethod 620 def get(*args, **kwargs) -> FloatAttr: ... 621 @staticmethod 622 def get_f32(*args, **kwargs) -> FloatAttr: ... 623 @staticmethod 624 def get_f64(*args, **kwargs) -> FloatAttr: ... 625 @staticmethod 626 def isinstance(arg: Any) -> bool: ... 627 @property 628 def type(self) -> Type: ... 629 @property 630 def value(self) -> float: ... 631 632# TODO: Auto-generated. Audit and fix. 633class FunctionType(Type): 634 def __init__(self, cast_from_type: Type) -> None: ... 635 @staticmethod 636 def get(*args, **kwargs) -> FunctionType: ... 637 @staticmethod 638 def isinstance(arg: Any) -> bool: ... 639 @property 640 def inputs(self) -> list: ... 641 @property 642 def results(self) -> list: ... 643 644# TODO: Auto-generated. Audit and fix. 645class IndexType(Type): 646 def __init__(self, cast_from_type: Type) -> None: ... 647 @staticmethod 648 def get(*args, **kwargs) -> IndexType: ... 649 @staticmethod 650 def isinstance(arg: Any) -> bool: ... 651 652class InferTypeOpInterface: 653 def __init__(self, object: object, context: Optional[Context] = None) -> None: ... 654 def inferReturnTypes(self, operands: Optional[List[Value]] = None, attributes: Optional[Attribute] = None, regions: Optional[List[Region]] = None, context: Optional[Context] = None, loc: Optional[Location] = None) -> List[Type]: ... 655 @property 656 def operation(self) -> Operation: ... 657 @property 658 def opview(self) -> OpView: ... 659 660class InsertionPoint: 661 current: ClassVar[InsertionPoint] = ... # read-only 662 @overload 663 def __init__(self, block: Block) -> None: ... 664 @overload 665 def __init__(self, beforeOperation: _OperationBase) -> None: ... 666 @staticmethod 667 def at_block_begin(block: Block) -> InsertionPoint: ... 668 @staticmethod 669 def at_block_terminator(block: Block) -> InsertionPoint: ... 670 def insert(self, operation: _OperationBase) -> None: ... 671 def __enter__(self) -> InsertionPoint: ... 672 def __exit__(self, arg0: object, arg1: object, arg2: object) -> None: ... 673 @property 674 def block(self) -> Block: ... 675 676# TODO: Auto-generated. Audit and fix. 677class IntegerAttr(Attribute): 678 def __init__(self, cast_from_attr: Attribute) -> None: ... 679 @staticmethod 680 def get(*args, **kwargs) -> IntegerAttr: ... 681 @staticmethod 682 def isinstance(arg: Any) -> bool: ... 683 @property 684 def type(self) -> Type: ... 685 @property 686 def value(self) -> int: ... 687 688# TODO: Auto-generated. Audit and fix. 689class IntegerSet: 690 def __init__(self, *args, **kwargs) -> None: ... 691 def _CAPICreate(self) -> IntegerSet: ... 692 def dump(self) -> None: ... 693 @staticmethod 694 def get(*args, **kwargs) -> IntegerSet: ... 695 @staticmethod 696 def get_empty(*args, **kwargs) -> IntegerSet: ... 697 def get_replaced(self, dim_exprs: list, symbol_exprs: list, num_result_dims: int, num_result_symbols: int) -> IntegerSet: ... 698 @overload 699 def __eq__(self, arg0: IntegerSet) -> bool: ... 700 @overload 701 def __eq__(self, arg0: object) -> bool: ... 702 def __hash__(self) -> int: ... 703 @property 704 def _CAPIPtr(self) -> object: ... 705 @property 706 def constraints(self) -> Any: ... 707 @property 708 def context(self) -> Context: ... 709 @property 710 def is_canonical_empty(self) -> bool: ... 711 @property 712 def n_dims(self) -> int: ... 713 @property 714 def n_equalities(self) -> int: ... 715 @property 716 def n_inequalities(self) -> int: ... 717 @property 718 def n_inputs(self) -> int: ... 719 @property 720 def n_symbols(self) -> int: ... 721 722# TODO: Auto-generated. Audit and fix. 723class IntegerSetConstraint: 724 def __init__(self, *args, **kwargs) -> None: ... 725 @property 726 def expr(self) -> AffineExpr: ... 727 @property 728 def is_eq(self) -> bool: ... 729 730# TODO: Auto-generated. Audit and fix. 731class IntegerSetConstraintList: 732 def __init__(self, *args, **kwargs) -> None: ... 733 def __add__(self, arg0: IntegerSetConstraintList) -> List[IntegerSetConstraint]: ... 734 @overload 735 def __getitem__(self, arg0: int) -> IntegerSetConstraint: ... 736 @overload 737 def __getitem__(self, arg0: slice) -> IntegerSetConstraintList: ... 738 def __len__(self) -> int: ... 739 740# TODO: Auto-generated. Audit and fix. 741class IntegerType(Type): 742 def __init__(self, cast_from_type: Type) -> None: ... 743 @staticmethod 744 def get_signed(*args, **kwargs) -> IntegerType: ... 745 @staticmethod 746 def get_signless(*args, **kwargs) -> IntegerType: ... 747 @staticmethod 748 def get_unsigned(*args, **kwargs) -> IntegerType: ... 749 @staticmethod 750 def isinstance(arg: Any) -> bool: ... 751 @property 752 def is_signed(self) -> bool: ... 753 @property 754 def is_signless(self) -> bool: ... 755 @property 756 def is_unsigned(self) -> bool: ... 757 @property 758 def width(self) -> int: ... 759 760class Location: 761 current: ClassVar[Location] = ... # read-only 762 __hash__: ClassVar[None] = ... # type: ignore 763 def _CAPICreate(self) -> Location: ... 764 @staticmethod 765 def callsite(callee: Location, frames: Sequence[Location], context: Optional[Context] = None) -> Location: ... 766 @staticmethod 767 def file(filename: str, line: int, col: int, context: Optional[Context] = None) -> Location: ... 768 @staticmethod 769 def fused(locations: Sequence[Location], metadata: Optional[Attribute] = None, context: Optional[Context] = None) -> Location: ... 770 @staticmethod 771 def name(name: str, childLoc: Optional[Location] = None, context: Optional[Context] = None) -> Location: ... 772 @staticmethod 773 def unknown(context: Optional[Context] = None) -> Any: ... 774 def __enter__(self) -> Location: ... 775 @overload 776 def __eq__(self, arg0: Location) -> bool: ... 777 @overload 778 def __eq__(self, arg0: object) -> bool: ... 779 def __exit__(self, arg0: object, arg1: object, arg2: object) -> None: ... 780 @property 781 def _CAPIPtr(self) -> object: ... 782 @property 783 def context(self) -> Context: ... 784 785# TODO: Auto-generated. Audit and fix. 786class MemRefType(ShapedType): 787 def __init__(self, cast_from_type: Type) -> None: ... 788 @staticmethod 789 def get(*args, **kwargs) -> MemRefType: ... 790 @staticmethod 791 def isinstance(arg: Any) -> bool: ... 792 @property 793 def affine_map(self) -> AffineMap: ... 794 @property 795 def layout(self) -> Attribute: ... 796 @property 797 def memory_space(self) -> Attribute: ... 798 799class Module: 800 def _CAPICreate(self) -> object: ... 801 @staticmethod 802 def create(loc: Optional[Location] = None) -> Module: ... 803 def dump(self) -> None: ... 804 @staticmethod 805 def parse(asm: str, context: Optional[Context] = None) -> Module: ... 806 @property 807 def _CAPIPtr(self) -> object: ... 808 @property 809 def body(self) -> Block: ... 810 @property 811 def context(self) -> Context: ... 812 @property 813 def operation(self) -> Operation: ... 814 815class NamedAttribute: 816 @property 817 def attr(self) -> Attribute: ... 818 @property 819 def name(self) -> str: ... 820 821# TODO: Auto-generated. Audit and fix. 822class NoneType(Type): 823 def __init__(self, cast_from_type: Type) -> None: ... 824 @staticmethod 825 def get(*args, **kwargs) -> NoneType: ... 826 @staticmethod 827 def isinstance(arg: Any) -> bool: ... 828 829class OpaqueType(Type): 830 def __init__(self, cast_from_type: Type) -> None: ... 831 @staticmethod 832 def get(*args, **kwargs) -> OpaqueType: ... 833 @staticmethod 834 def isinstance(arg: Any) -> bool: ... 835 @property 836 def dialect_namespace(self) -> str: ... 837 @property 838 def data(self) -> str: ... 839 840class OpAttributeMap: 841 def __contains__(self, arg0: str) -> bool: ... 842 def __delitem__(self, arg0: str) -> None: ... 843 @overload 844 def __getitem__(self, arg0: str) -> Attribute: ... 845 @overload 846 def __getitem__(self, arg0: int) -> NamedAttribute: ... 847 def __len__(self) -> int: ... 848 def __setitem__(self, arg0: str, arg1: Attribute) -> None: ... 849 850class OpOperandList: 851 def __add__(self, arg0: OpOperandList) -> List[Value]: ... 852 @overload 853 def __getitem__(self, arg0: int) -> Value: ... 854 @overload 855 def __getitem__(self, arg0: slice) -> OpOperandList: ... 856 def __len__(self) -> int: ... 857 def __setitem__(self, arg0: int, arg1: Value) -> None: ... 858 859class OpResult(Value): 860 def __init__(self, value: Value) -> None: ... 861 @staticmethod 862 def isinstance(arg: Any) -> bool: ... 863 @property 864 def owner(self) -> _OperationBase: ... 865 @property 866 def result_number(self) -> int: ... 867 868class OpResultList: 869 def __add__(self, arg0: OpResultList) -> List[OpResult]: ... 870 @overload 871 def __getitem__(self, arg0: int) -> OpResult: ... 872 @overload 873 def __getitem__(self, arg0: slice) -> OpResultList: ... 874 def __len__(self) -> int: ... 875 @property 876 def types(self) -> List[Type]: ... 877 878class OpView(_OperationBase): 879 _ODS_OPERAND_SEGMENTS: ClassVar[None] = ... 880 _ODS_REGIONS: ClassVar[tuple] = ... 881 _ODS_RESULT_SEGMENTS: ClassVar[None] = ... 882 def __init__(self, operation: _OperationBase) -> None: ... 883 @classmethod 884 def build_generic( 885 cls: _Type[_TOperation], 886 results: Optional[Sequence[Type]] = None, 887 operands: Optional[Sequence[Value]] = None, 888 attributes: Optional[Dict[str, Attribute]] = None, 889 successors: Optional[Sequence[Block]] = None, 890 regions: Optional[int] = None, 891 loc: Optional[Location] = None, 892 ip: Optional[InsertionPoint] = None) -> _TOperation: ... 893 @property 894 def context(self) -> Context: ... 895 @property 896 def operation(self) -> Operation: ... 897 898class Operation(_OperationBase): 899 def _CAPICreate(self) -> object: ... 900 @staticmethod 901 def create(name: str, results: Optional[Sequence[Type]] = None, 902 operands: Optional[Sequence[Value]] = None, 903 attributes: Optional[Dict[str, Attribute]] = None, 904 successors: Optional[Sequence[Block]] = None, 905 regions: int = 0, 906 loc: Optional[Location] = None, 907 ip: Optional[InsertionPoint] = None) -> _OperationBase: ... 908 def erase(self) -> None: ... 909 @property 910 def _CAPIPtr(self) -> object: ... 911 @property 912 def context(self) -> Context: ... 913 @property 914 def name(self) -> str: ... 915 @property 916 def opview(self) -> OpView: ... 917 @property 918 def parent(self) -> Optional[_OperationBase]: ... 919 920class OperationIterator: 921 def __iter__(self) -> OperationIterator: ... 922 def __next__(self) -> OpView: ... 923 924class OperationList: 925 def __getitem__(self, arg0: int) -> OpView: ... 926 def __iter__(self) -> OperationIterator: ... 927 def __len__(self) -> int: ... 928 929# TODO: Auto-generated. Audit and fix. 930class RankedTensorType(ShapedType): 931 def __init__(self, cast_from_type: Type) -> None: ... 932 @staticmethod 933 def get(*args, **kwargs) -> RankedTensorType: ... 934 @staticmethod 935 def isinstance(arg: Any) -> bool: ... 936 @property 937 def encoding(self) -> Optional[Attribute]: ... 938 939class Region: 940 __hash__: ClassVar[None] = ... # type: ignore 941 @overload 942 def __eq__(self, arg0: Region) -> bool: ... 943 @overload 944 def __eq__(self, arg0: object) -> bool: ... 945 def __iter__(self) -> BlockIterator: ... 946 @property 947 def blocks(self) -> BlockList: ... 948 @property 949 def owner(self) -> OpView: ... 950 951class RegionIterator: 952 def __iter__(self) -> RegionIterator: ... 953 def __next__(self) -> Region: ... 954 955class RegionSequence: 956 def __getitem__(self, arg0: int) -> Region: ... 957 def __len__(self) -> int: ... 958 959# TODO: Auto-generated. Audit and fix. 960class ShapedType(Type): 961 def __init__(self, cast_from_type: Type) -> None: ... 962 def get_dim_size(self, dim: int) -> int: ... 963 def is_dynamic_dim(self, dim: int) -> bool: ... 964 def is_dynamic_size(self, *args, **kwargs) -> Any: ... 965 def is_dynamic_stride_or_offset(self, dim_size: int) -> bool: ... 966 @staticmethod 967 def isinstance(arg: Any) -> bool: ... 968 @property 969 def element_type(self) -> Type: ... 970 @property 971 def has_rank(self) -> bool: ... 972 @property 973 def has_static_shape(self) -> bool: ... 974 @property 975 def rank(self) -> int: ... 976 @property 977 def shape(self) -> List[int]: ... 978 979# TODO: Auto-generated. Audit and fix. 980class StringAttr(Attribute): 981 def __init__(self, cast_from_attr: Attribute) -> None: ... 982 @staticmethod 983 def get(*args, **kwargs) -> Any: ... 984 @staticmethod 985 def get_typed(*args, **kwargs) -> Any: ... 986 @staticmethod 987 def isinstance(arg: Any) -> bool: ... 988 @property 989 def type(self) -> Type: ... 990 @property 991 def value(self) -> str: ... 992 993class SymbolTable: 994 def __init__(self, arg0: _OperationBase) -> None: ... 995 def erase(self, operation: _OperationBase) -> None: ... 996 @staticmethod 997 def get_symbol_name(symbol: _OperationBase) -> Attribute: ... 998 @staticmethod 999 def get_visibility(symbol: _OperationBase) -> Attribute: ... 1000 def insert(self, operation: _OperationBase) -> Attribute: ... 1001 @staticmethod 1002 def replace_all_symbol_uses(old_symbol: str, new_symbol: str, from_op: _OperationBase) -> None: ... 1003 @staticmethod 1004 def set_symbol_name(symbol: _OperationBase, name: str) -> None: ... 1005 @staticmethod 1006 def set_visibility(symbol: _OperationBase, visibility: str) -> None: ... 1007 @staticmethod 1008 def walk_symbol_tables(from_op: _OperationBase, all_sym_uses_visible: bool, callback: Callable[[_OperationBase, bool], None]) -> None: ... 1009 def __contains__(self, arg0: str) -> bool: ... 1010 def __delitem__(self, arg0: str) -> None: ... 1011 def __getitem__(self, arg0: str) -> OpView: ... 1012 1013# TODO: Auto-generated. Audit and fix. 1014class TupleType(Type): 1015 def __init__(self, cast_from_type: Type) -> None: ... 1016 @staticmethod 1017 def get_tuple(*args, **kwargs) -> TupleType: ... 1018 def get_type(self, pos: int) -> Type: ... 1019 @staticmethod 1020 def isinstance(arg: Any) -> bool: ... 1021 @property 1022 def num_types(self) -> int: ... 1023 1024# TODO: Auto-generated. Audit and fix. 1025class TypeAttr(Attribute): 1026 def __init__(self, cast_from_attr: Attribute) -> None: ... 1027 @staticmethod 1028 def get(*args, **kwargs) -> Any: ... 1029 @staticmethod 1030 def isinstance(arg: Any) -> bool: ... 1031 @property 1032 def type(self) -> Type: ... 1033 @property 1034 def value(self) -> Type: ... 1035 1036# TODO: Auto-generated. Audit and fix. 1037class UnitAttr(Attribute): 1038 def __init__(self, cast_from_attr: Attribute) -> None: ... 1039 @staticmethod 1040 def get(*args, **kwargs) -> Any: ... 1041 @staticmethod 1042 def isinstance(arg: Any) -> bool: ... 1043 @property 1044 def type(self) -> Type: ... 1045 1046# TODO: Auto-generated. Audit and fix. 1047class UnrankedMemRefType(ShapedType): 1048 def __init__(self, cast_from_type: Type) -> None: ... 1049 @staticmethod 1050 def get(*args, **kwargs) -> UnrankedMemRefType: ... 1051 @staticmethod 1052 def isinstance(arg: Any) -> bool: ... 1053 @property 1054 def memory_space(self) -> Attribute: ... 1055 1056# TODO: Auto-generated. Audit and fix. 1057class UnrankedTensorType(ShapedType): 1058 def __init__(self, cast_from_type: Type) -> None: ... 1059 @staticmethod 1060 def get(*args, **kwargs) -> UnrankedTensorType: ... 1061 @staticmethod 1062 def isinstance(arg: Any) -> bool: ... 1063 1064# TODO: Auto-generated. Audit and fix. 1065class VectorType(ShapedType): 1066 def __init__(self, cast_from_type: Type) -> None: ... 1067 @staticmethod 1068 def get(*args, **kwargs) -> VectorType: ... 1069 @staticmethod 1070 def isinstance(arg: Any) -> bool: ... 1071 1072class _GlobalDebug: 1073 flag: ClassVar[bool] = ... 1074