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

Function _deferred

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

Created context with certain exit function. Parameters ---------- exit_f : Callable[[], None] The function to call when exiting the context. Returns ------- res : Any The created context.

(exit_f: Callable[[], None])

Source from the content-addressed store, hash-verified

41
42
43def _deferred(exit_f: Callable[[], None]):
44 """Created context with certain exit function.
45
46 Parameters
47 ----------
48 exit_f : Callable[[], None]
49 The function to call when exiting the context.
50
51 Returns
52 -------
53 res : Any
54 The created context.
55 """
56
57 @contextmanager
58 def context():
59 try:
60 yield
61 finally:
62 exit_f()
63
64 return context()
65
66
67def _do_nothing(*args, **kwargs): # pylint: disable=unused-argument

Callers 3

with_frameMethod · 0.85
with_dispatch_tokenMethod · 0.85
with_diag_sourceMethod · 0.85

Calls 1

contextFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…