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

Function dynamic_strided_slice

python/tvm/topi/transform.py:238–270  ·  view source on GitHub ↗

Slice of an array. Parameters ---------- a : tvm.te.Tensor The tensor to be sliced. begin : tvm.te.Tensor The indices to begin with in the slicing. end : tvm.te.Tensor Indices indicating end of the slice. strides : tvm.te.Tensor Specifies t

(a, begin, end, strides, output_shape)

Source from the content-addressed store, hash-verified

236
237
238def dynamic_strided_slice(a, begin, end, strides, output_shape):
239 """Slice of an array.
240
241 Parameters
242 ----------
243 a : tvm.te.Tensor
244 The tensor to be sliced.
245
246 begin : tvm.te.Tensor
247 The indices to begin with in the slicing.
248
249 end : tvm.te.Tensor
250 Indices indicating end of the slice.
251
252 strides : tvm.te.Tensor
253 Specifies the stride values, it can be negative
254 in that case, the input tensor will be reversed
255 in that particular axis.
256
257 output_shape: list of PrimExpr
258 Specifies the output shape
259
260 Returns
261 -------
262 ret : tvm.te.Tensor
263 """
264 if not isinstance(begin, tvm.te.Tensor):
265 begin = const_vector(begin)
266 if not isinstance(end, tvm.te.Tensor):
267 end = const_vector(end)
268 if not isinstance(strides, tvm.te.Tensor):
269 strides = const_vector(strides)
270 return cpp.relax_dynamic_strided_slice(a, begin, end, strides, output_shape)
271
272
273@tvm.te.tag_scope(tag=tag.INJECTIVE + ",strided_set")

Callers

nothing calls this directly

Calls 1

const_vectorFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…