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

Function transform_params

tests/python/disco/test_callback.py:43–57  ·  view source on GitHub ↗
(
        rank_arg: R.Prim(value="rank"),
        fget_item: R.Callable([R.Object, R.Prim("int64")], R.Object),
    )

Source from the content-addressed store, hash-verified

41
42 @R.function
43 def transform_params(
44 rank_arg: R.Prim(value="rank"),
45 fget_item: R.Callable([R.Object, R.Prim("int64")], R.Object),
46 ):
47 rank = T.int64()
48
49 A = fget_item(R.str("A"), R.prim_value(0))
50 A = R.match_cast(A, R.Tensor([4, 4], "int32"))
51 A = R.strided_slice(A, axes=[0], begin=[rank * 2], end=[(rank + 1) * 2])
52
53 B = fget_item(R.str("B"), R.prim_value(1))
54 B = R.match_cast(B, R.Tensor([2, 2], "float32"))
55 B = R.strided_slice(B, axes=[1], begin=[rank * 1], end=[(rank + 1) * 1])
56
57 return (A, B)
58
59 pipeline = tvm.ir.transform.Sequential(
60 [

Callers 1

test_callbackFunction · 0.85

Calls 4

fget_itemFunction · 0.85
match_castMethod · 0.80
TensorMethod · 0.80
strided_sliceMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…