MCPcopy Index your code
hub / github.com/apache/tvm / slice

Method slice

tests/python/relax/test_transform_lift_transform_params.py:1533–1542  ·  view source on GitHub ↗
(
            Input_2d: T.Buffer(shape=[16, 16], dtype="int32"),
            Output_Slice: T.Buffer(shape=[16], dtype="int32"),
            slice_index: T.int64,
        )

Source from the content-addressed store, hash-verified

1531
1532 @T.prim_func(private=True, s_tir=True)
1533 def slice(
1534 Input_2d: T.Buffer(shape=[16, 16], dtype="int32"),
1535 Output_Slice: T.Buffer(shape=[16], dtype="int32"),
1536 slice_index: T.int64,
1537 ):
1538 T.func_attr({"tirx.noalias": True})
1539 for j in range(16):
1540 with T.sblock("T_full"):
1541 vj = T.axis.remap("S", [j])
1542 Output_Slice[vj] = Input_2d[slice_index, vj]
1543
1544 @I.ir_module(s_tir=True)
1545 class Expected:

Callers 10

funcMethod · 0.45
case1Function · 0.45
case2Function · 0.45
case3Function · 0.45
case4Function · 0.45
case_swizzle_sliceFunction · 0.45
case_compose_sliceFunction · 0.45
case_compose_slice_2dFunction · 0.45

Calls 1

remapMethod · 0.80

Tested by

no test coverage detected