()
| 139 | |
| 140 | |
| 141 | def test_nested_function(): |
| 142 | @I.ir_module(s_tir=True) |
| 143 | class NestedFunction: |
| 144 | @R.function |
| 145 | def main(x: R.Tensor((), "int32")) -> R.Tensor((), "int32"): |
| 146 | @R.function |
| 147 | def nested(y: R.Tensor((), "int32")) -> R.Tensor((), "int32"): |
| 148 | return y |
| 149 | |
| 150 | z = nested(x) |
| 151 | return z |
| 152 | |
| 153 | _assert_print( |
| 154 | NestedFunction, |
| 155 | """ |
| 156 | # from tvm.script import ir as I |
| 157 | # from tvm.script import relax as R |
| 158 | |
| 159 | @I.ir_module |
| 160 | class Module: |
| 161 | @R.function |
| 162 | def main(x: R.Tensor((), dtype="int32")) -> R.Tensor((), dtype="int32"): |
| 163 | # from tvm.script import relax as R |
| 164 | |
| 165 | @R.function |
| 166 | def nested(y: R.Tensor((), dtype="int32")) -> R.Tensor((), dtype="int32"): |
| 167 | return y |
| 168 | |
| 169 | z: R.Tensor((), dtype="int32") = nested(x) |
| 170 | return z |
| 171 | """, |
| 172 | ) |
| 173 | |
| 174 | |
| 175 | def test_object_struct_info(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…