An object corresponds to each VM function, working as a context manager.
| 44 | |
| 45 | |
| 46 | class VMFuncScope: |
| 47 | """An object corresponds to each VM function, working as a context manager.""" |
| 48 | |
| 49 | stack: list["VMFuncScope"] = [] |
| 50 | |
| 51 | def __init__(self, exit_callback): |
| 52 | self.exit_callback = exit_callback |
| 53 | |
| 54 | def __enter__(self): |
| 55 | VMFuncScope.stack.append(self) |
| 56 | return self |
| 57 | |
| 58 | def __exit__(self, ptype, value, trace): |
| 59 | VMFuncScope.stack.pop() |
| 60 | self.exit_callback() |
| 61 | |
| 62 | |
| 63 | @tvm_ffi.register_object("relax.ExecBuilder") |
no outgoing calls
no test coverage detected
searching dependent graphs…