MCPcopy Create free account
hub / github.com/apache/tvm / Range

Class Range

python/tvm/ir/expr.py:112–173  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

110
111@tvm_ffi.register_object("ir.Range")
112class 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:

Callers 11

DTensorFunction · 0.90
test_constantFunction · 0.90
test_dtensor_struct_infoFunction · 0.90
test_dtensor_struct_infoFunction · 0.90
test_call_tir_dtensorFunction · 0.90
create_test_statementsFunction · 0.90
test_match_buffer_regionFunction · 0.90
test_buffer_regionFunction · 0.90
test_rangeFunction · 0.90
create_test_statementsFunction · 0.90

Calls

no outgoing calls

Tested by 10

test_constantFunction · 0.72
test_dtensor_struct_infoFunction · 0.72
test_dtensor_struct_infoFunction · 0.72
test_call_tir_dtensorFunction · 0.72
create_test_statementsFunction · 0.72
test_match_buffer_regionFunction · 0.72
test_buffer_regionFunction · 0.72
test_rangeFunction · 0.72
create_test_statementsFunction · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…