Int constant. Parameters ---------- dtype : str The data type value : int The constant value. span : Optional[Span] The location of this expression in the source code.
| 609 | |
| 610 | @tvm_ffi.register_object("ir.IntImm") |
| 611 | class IntImm(ConstExpr): |
| 612 | """Int constant. |
| 613 | |
| 614 | Parameters |
| 615 | ---------- |
| 616 | dtype : str |
| 617 | The data type |
| 618 | |
| 619 | value : int |
| 620 | The constant value. |
| 621 | |
| 622 | span : Optional[Span] |
| 623 | The location of this expression in the source code. |
| 624 | """ |
| 625 | |
| 626 | value: int |
| 627 | |
| 628 | def __init__(self, dtype: str, value: int, span: Span | None = None) -> None: |
| 629 | self.__init_handle_by_constructor__( |
| 630 | tvm.ir._ffi_api.IntImm, |
| 631 | dtype, |
| 632 | value, |
| 633 | span, # type: ignore |
| 634 | ) |
| 635 | |
| 636 | def __hash__(self) -> int: |
| 637 | return self.value |
| 638 | |
| 639 | def __int__(self) -> int: |
| 640 | return self.value |
| 641 | |
| 642 | def __nonzero__(self) -> bool: |
| 643 | return self.value != 0 |
| 644 | |
| 645 | def __eq__(self, other: PrimExpr) -> PrimExpr: |
| 646 | return _ffi_api._OpEQ(self, other, None) # type: ignore |
| 647 | |
| 648 | def __ne__(self, other: PrimExpr) -> PrimExpr: |
| 649 | return _ffi_api._OpNE(self, other, None) # type: ignore |
| 650 | |
| 651 | def __bool__(self) -> bool: |
| 652 | return self.__nonzero__() |
| 653 | |
| 654 | |
| 655 | @tvm_ffi.register_object("tirx.StringImm") # type: ignore |
no outgoing calls
searching dependent graphs…