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)
| 236 | |
| 237 | |
| 238 | def 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") |
nothing calls this directly
no test coverage detected
searching dependent graphs…