Skip to content

Commit

Permalink
[dynamo][easy] support sys.intern (pytorch#136081)
Browse files Browse the repository at this point in the history
  • Loading branch information
XuehaiPan authored and pytorchmergebot committed Sep 24, 2024
1 parent 1266be2 commit 73c10a0
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion torch/_dynamo/polyfills/sys.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,18 @@
Python polyfills for sys
"""

from __future__ import annotations

__all__ = [] # type: ignore[var-annotated]
import sys

from ..decorators import substitute_in_graph


__all__ = [
"intern",
]


@substitute_in_graph(sys.intern, can_constant_fold_through=True)
def intern(string: str, /) -> str:
return string

0 comments on commit 73c10a0

Please sign in to comment.