MCPcopy Create free account
hub / github.com/pytorch/executorch / setting_python_recursive_limit

Function setting_python_recursive_limit

exir/common.py:129–140  ·  view source on GitHub ↗

Temporarily increase the python interpreter stack recursion limit. This is mostly used for pickling large scale modules.

(limit: int = 10000)

Source from the content-addressed store, hash-verified

127
128@contextmanager
129def setting_python_recursive_limit(limit: int = 10000) -> Generator[None, None, None]:
130 """
131 Temporarily increase the python interpreter stack recursion limit.
132 This is mostly used for pickling large scale modules.
133 """
134 default = sys.getrecursionlimit()
135 if limit > default:
136 sys.setrecursionlimit(limit)
137 try:
138 yield
139 finally:
140 sys.setrecursionlimit(default)

Callers 2

dynamo_traceFunction · 0.90
is_identical_graphFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected