Enter the with-scope for IRBuilder, which allows the IRBuilder to be discoverable using `IRBuilder.current()`. Examples -------- .. code-block:: python from tvm.script.ir_builder import IRBuilder with IRBuilder() as builder:
(self)
| 116 | ) |
| 117 | |
| 118 | def __enter__(self) -> "IRBuilder": |
| 119 | """Enter the with-scope for IRBuilder, which allows the IRBuilder to be discoverable |
| 120 | using `IRBuilder.current()`. |
| 121 | |
| 122 | Examples |
| 123 | -------- |
| 124 | .. code-block:: python |
| 125 | |
| 126 | from tvm.script.ir_builder import IRBuilder |
| 127 | |
| 128 | with IRBuilder() as builder: |
| 129 | assert IRBuilder.current() == builder |
| 130 | |
| 131 | """ |
| 132 | _ffi_api.IRBuilderEnter(self) # type: ignore[attr-defined] # pylint: disable=no-member |
| 133 | return self |
| 134 | |
| 135 | def __exit__(self, ptype, value, trace) -> None: # pylint: disable=unused-argument |
| 136 | _ffi_api.IRBuilderExit(self) # type: ignore[attr-defined] # pylint: disable=no-member |
no outgoing calls
no test coverage detected