mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Initially discussed here: https://github.com/pytorch/pytorch/pull/132945#discussion_r1957366131 Previously `torch.xpu.get_arch_list()` got relaxed to work even if XPU device is not available. However, we overlooked the case when pytorch is not compiled with XPU support. In such a case function throws an exception. This commit adjusts this behavior and makes function return `[]` even if pytorch is not compiled with XPU support. CC: @EikanWang @fengyuan14 @guangyey @malfet @albanD Pull Request resolved: https://github.com/pytorch/pytorch/pull/147431 Approved by: https://github.com/guangyey, https://github.com/EikanWang, https://github.com/albanD