MCPcopy Create free account
hub / github.com/apache/tvm-ffi / test_pyfunc_convert

Function test_pyfunc_convert

tests/python/test_function.py:149–161  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

147
148
149def test_pyfunc_convert() -> None:
150 def add(a: int, b: int) -> int:
151 return a + b
152
153 fadd = tvm_ffi.convert(add)
154 assert isinstance(fadd, tvm_ffi.Function)
155 assert fadd(1, 2) == 3
156
157 def fapply(f: Any, *args: Any) -> Any:
158 return f(*args)
159
160 fapply = tvm_ffi.convert(fapply)
161 assert fapply(add, 1, 3.3) == 4.3
162
163
164def test_global_func() -> None:

Callers

nothing calls this directly

Calls 2

fapplyFunction · 0.85
convertMethod · 0.45

Tested by

no test coverage detected