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

Function test_extern_func

tests/python/relax/test_tvmscript_printer_relax.py:75–99  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

73
74
75def test_extern_func():
76 @R.function
77 def func(a: R.Tensor((10, 10))) -> R.Tensor((10, 10)): # type: ignore
78 return a
79
80 obj = IRModule(
81 {
82 "func": func,
83 "my_ext": relax.ExternFunc("my_ext"),
84 }
85 )
86 _assert_print(
87 obj,
88 """
89# from tvm.script import ir as I
90# from tvm.script import relax as R
91
92@I.ir_module
93class Module:
94 my_ext = R.ExternFunc("my_ext")
95 @R.function
96 def func(a: R.Tensor((10, 10))) -> R.Tensor((10, 10)):
97 return a
98""",
99 )
100
101
102def test_extern_func_with_struct_info():

Callers

nothing calls this directly

Calls 2

IRModuleClass · 0.90
_assert_printFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…