MCPcopy Index your code
hub / github.com/apache/tvm / with_frame

Method with_frame

python/tvm/script/parser/core/parser.py:233–247  ·  view source on GitHub ↗

Create a new variable table frame as with statement. Returns ------- res : Any The context with new variable table frame.

(self)

Source from the content-addressed store, hash-verified

231 self.name2value = defaultdict(list)
232
233 def with_frame(self):
234 """Create a new variable table frame as with statement.
235
236 Returns
237 -------
238 res : Any
239 The context with new variable table frame.
240 """
241
242 def pop_frame():
243 frame = self.frames.pop()
244 frame.pop_all(lambda name: self.name2value[name].pop())
245
246 self.frames.append(VarTableFrame())
247 return _deferred(pop_frame)
248
249 def add(self, var: str, value: Any, allow_shadowing: bool = False):
250 """Add a new variable to variable table.

Callers 15

visit_function_defFunction · 0.80
visit_withFunction · 0.80
visit_ifFunction · 0.80
_visit_class_defFunction · 0.80
__call__Method · 0.80
parseMethod · 0.80
visit_forFunction · 0.80
visit_whileFunction · 0.80
visit_aug_assignFunction · 0.80
visit_withFunction · 0.80
visit_function_defFunction · 0.80

Calls 3

VarTableFrameClass · 0.85
_deferredFunction · 0.85
appendMethod · 0.45

Tested by

no test coverage detected