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

Function main

tests/python/relax/test_tvmscript_parser.py:1091–1107  ·  view source on GitHub ↗
(x: R.Tensor((2, 3), "float32"), y: R.Tensor((2, 3), "float32"))

Source from the content-addressed store, hash-verified

1089def test_local_function():
1090 @R.function
1091 def main(x: R.Tensor((2, 3), "float32"), y: R.Tensor((2, 3), "float32")) -> R.Tensor(
1092 (2, 3), "float32"
1093 ):
1094 @R.function
1095 def outer_func(
1096 c1: R.Tensor((2, 3), "float32"),
1097 ) -> R.Callable((R.Tensor(None, "float32", ndim=2),), R.Tensor(None, "float32", ndim=2)):
1098 @R.function
1099 def inner_func(x1: R.Tensor((2, 3), "float32")):
1100 s: R.Tensor((2, 3), "float32") = R.add(x1, c1)
1101 return s
1102
1103 return inner_func
1104
1105 in_call = outer_func(x)
1106 res = in_call(y)
1107 return res
1108
1109 main_bindings = main.body.blocks[0].bindings
1110 assert len(main_bindings) == 3

Callers

nothing calls this directly

Calls 2

outer_funcFunction · 0.85
TensorMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…