Represent a range in TVM. You do not need to create a Range explicitly. Python lists and tuples will be converted automatically to a Range in API functions. Parameters ---------- begin : PrimExpr The begin value of the range when end is None. Otherwise it is the
| 110 | |
| 111 | @tvm_ffi.register_object("ir.Range") |
| 112 | class Range(Node, Scriptable): |
| 113 | """Represent a range in TVM. |
| 114 | |
| 115 | You do not need to create a Range explicitly. |
| 116 | Python lists and tuples will be converted automatically to a Range in API functions. |
| 117 | |
| 118 | Parameters |
| 119 | ---------- |
| 120 | begin : PrimExpr |
| 121 | The begin value of the range when end is None. |
| 122 | Otherwise it is the length of the range. |
| 123 | |
| 124 | end : Optional[PrimExpr] |
| 125 | The end value of the range. |
| 126 | |
| 127 | span : Optional[Span] |
| 128 | The location of this node in the source code. |
| 129 | |
| 130 | Note |
| 131 | ---- |
| 132 | The constructor creates the range `[begin, end)` |
| 133 | if the end argument is not None. Otherwise, it creates `[0, begin)`. |
| 134 | """ |
| 135 | |
| 136 | min: PrimExpr |
| 137 | extent: PrimExpr |
| 138 | span: Span | None |
| 139 | |
| 140 | def __init__( |
| 141 | self, begin: PrimExpr, end: PrimExpr | None = None, span: Span | None = None |
| 142 | ) -> None: |
| 143 | self.__init_handle_by_constructor__(_ffi_api.Range, begin, end, span) |
| 144 | |
| 145 | @staticmethod |
| 146 | def from_min_extent(min_value: PrimExpr, extent: PrimExpr, span: Span | None = None) -> "Range": |
| 147 | """Construct a Range by min and extent. |
| 148 | |
| 149 | This constructs a range in [min_value, min_value + extent) |
| 150 | |
| 151 | Parameters |
| 152 | ---------- |
| 153 | min_value : PrimExpr |
| 154 | The minimum value of the range. |
| 155 | |
| 156 | extent : PrimExpr |
| 157 | The extent of the range. |
| 158 | |
| 159 | span : Optional[Span] |
| 160 | The location of this node in the source code. |
| 161 | |
| 162 | Returns |
| 163 | ------- |
| 164 | rng : Range |
| 165 | The constructed range. |
| 166 | """ |
| 167 | return _ffi_api.Range_from_min_extent(min_value, extent, span) |
| 168 | |
| 169 | def __eq__(self, other: Object) -> bool: |
no outgoing calls
searching dependent graphs…