def is_available() -> bool:
    r"""Returns a bool indicating if XPU is currently available."""
    # This function device_count() never throws and returns 0 if driver is missing
    # or can't be initialized
    return device_count() > 0
Returns a bool indicating if XPU is currently available.
intel_extension_for_pytorch/xpu/__init__.py