mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-08 07:39:33 +01:00
Signed-off-by: Edward Z. Yang <ezyang@meta.com> Pull Request resolved: https://github.com/pytorch/pytorch/pull/106249 Approved by: https://github.com/Skylion007
10 lines
202 B
Python
10 lines
202 B
Python
from importlib.util import find_spec
|
|
|
|
import torch
|
|
|
|
__all__ = ["amp_definitely_not_available"]
|
|
|
|
|
|
def amp_definitely_not_available():
|
|
return not (torch.cuda.is_available() or find_spec("torch_xla"))
|