MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / exclude_from_trace

Function exclude_from_trace

imperative/python/megengine/jit/tracing.py:75–88  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

73
74@contextlib.contextmanager
75def exclude_from_trace():
76 global skip_tracing
77 if skip_tracing or (active_trace is None):
78 yield
79 return
80 try:
81 skip_tracing = True
82 if active_trace is not None:
83 active_trace._begin_excluded_region()
84 yield
85 if active_trace is not None:
86 active_trace._end_excluded_region()
87 finally:
88 skip_tracing = False
89
90
91def array_comparator(lhs, rhs):

Callers 1

fFunction · 0.90

Calls 2

_end_excluded_regionMethod · 0.80

Tested by 1

fFunction · 0.72