MCPcopy Create free account
hub / github.com/apache/tvm / __enter__

Method __enter__

python/tvm/script/ir_builder/base.py:118–133  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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

Callers 1

pre_visit_local_functionFunction · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected