Windows Dynamo Error Removal CI Check (#115969)

Rebase of #111313 onto `main`, for CI validation

Co-authored-by: Stella Laurenzo <stellaraccident@gmail.com>
Pull Request resolved: https://github.com/pytorch/pytorch/pull/115969
Approved by: https://github.com/ezyang
This commit is contained in:
gs-olive
2024-02-08 21:23:41 +00:00
committed by PyTorch MergeBot
parent 0827510fd3
commit 45e7af5818
16 changed files with 66 additions and 13 deletions

View File

@ -423,6 +423,22 @@ def skipIfNoDynamoSupport(fn):
fn(*args, **kwargs)
return wrapper
def skipIfNoInductorSupport(fn):
reason = "inductor doesn't support."
if isinstance(fn, type):
if not torchdynamo.is_inductor_supported():
fn.__unittest_skip__ = True
fn.__unittest_skip_why__ = reason
return fn
@functools.wraps(fn)
def wrapper(*args, **kwargs):
if not torchdynamo.is_inductor_supported():
raise unittest.SkipTest(reason)
else:
fn(*args, **kwargs)
return wrapper
try:
import torchvision # noqa: F401
HAS_TORCHVISION = True