mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
This reverts commit 216bd6091ec52865052282eced7e6d5d2a4b4fb4. Reverted https://github.com/pytorch/pytorch/pull/155978 on behalf of https://github.com/huydhn due to Some tests are still failing in trunk ([comment](https://github.com/pytorch/pytorch/pull/155978#issuecomment-3014185210))
26 lines
447 B
Python
26 lines
447 B
Python
"""
|
|
Python polyfills for sys
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
import sys
|
|
|
|
from ..decorators import substitute_in_graph
|
|
|
|
|
|
__all__ = [
|
|
"intern",
|
|
"getrecursionlimit",
|
|
]
|
|
|
|
|
|
@substitute_in_graph(sys.intern, can_constant_fold_through=True)
|
|
def intern(string: str, /) -> str:
|
|
return string
|
|
|
|
|
|
@substitute_in_graph(sys.getrecursionlimit, can_constant_fold_through=True)
|
|
def getrecursionlimit() -> int:
|
|
return sys.getrecursionlimit()
|