[dynamo] utility to generate bytecode from template function (#127359)

This will be helpful in reducing some of the hardcoded and python-version-dependent bytecode generation in various places in dynamo - e.g. resume function generation and object reconstruction.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/127359
Approved by: https://github.com/jansel
ghstack dependencies: #127329
This commit is contained in:
William Wen
2024-05-29 10:56:23 -07:00
committed by PyTorch MergeBot
parent 5d316c81be
commit d44ab8ba6d
3 changed files with 234 additions and 1 deletions

View File

@ -343,6 +343,12 @@ def skipIfNotPy311(fn):
return unittest.skip(fn)
def skipIfNotPy312(fn):
if sys.version_info >= (3, 12):
return fn
return unittest.skip(fn)
def xfailIfPy312(fn):
if sys.version_info >= (3, 12):
return unittest.expectedFailure(fn)