import_utils.py 329 Bytes
Newer Older
fxmarty's avatar
fxmarty committed
1
2
import torch

3
4
5
6
7
8
9
10
def is_xpu_available():
    try:
        import intel_extension_for_pytorch
    except ImportError:
        return False

    return hasattr(torch, "xpu") and torch.xpu.is_available()

fxmarty's avatar
fxmarty committed
11
12
IS_ROCM_SYSTEM = torch.version.hip is not None
IS_CUDA_SYSTEM = torch.version.cuda is not None
13
IS_XPU_SYSTEM = is_xpu_available()