mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-07 12:21:27 +01:00
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/PaliC, https://github.com/thiagocrepaldi
17 lines
404 B
Python
17 lines
404 B
Python
# mypy: ignore-errors
|
|
|
|
import sys
|
|
|
|
from torch._dynamo import register_backend
|
|
|
|
|
|
@register_backend
|
|
def inductor(*args, **kwargs):
|
|
if sys.platform == "win32":
|
|
raise RuntimeError("Windows not yet supported for inductor")
|
|
|
|
# do import here to avoid loading inductor into memory when it is not used
|
|
from torch._inductor.compile_fx import compile_fx
|
|
|
|
return compile_fx(*args, **kwargs)
|