从 torch 2.5 开始似乎官方支持了,但是需要装点驱动pacin intel-compute-runtime intel-oneapi-mkl pip install torch --index-url https://download.pytorch.org/whl/xpu然后应该就行了import torch torch.xpu.is_available() Last modification:September 7, 2025 © Allow specification reprint Like 如果觉得我的文章对你有用,请随意赞赏