()
| 73 | |
| 74 | |
| 75 | def 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 |
| 93 | class 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 | |
| 102 | def test_extern_func_with_struct_info(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…