Skip to content

Commit c8661f0

Browse files
committed
check_torch_dependencies
1 parent 736cc7c commit c8661f0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/diffusers/utils/testing_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1085,7 +1085,7 @@ def _is_torch_fp64_available(device):
10851085
}
10861086
BACKEND_RESET_PEAK_MEMORY_STATS = {
10871087
"cuda": torch.cuda.reset_peak_memory_stats,
1088-
"xpu": torch.xpu.reset_peak_memory_stats,
1088+
"xpu": getattr(torch.xpu, "reset_peak_memory_stats", None),
10891089
"default": None,
10901090
}
10911091
BACKEND_RESET_MAX_MEMORY_ALLOCATED = {
@@ -1094,7 +1094,7 @@ def _is_torch_fp64_available(device):
10941094
}
10951095
BACKEND_MAX_MEMORY_ALLOCATED = {
10961096
"cuda": torch.cuda.max_memory_allocated,
1097-
"xpu": torch.xpu.max_memory_allocated,
1097+
"xpu": getattr(torch.xpu, "max_memory_allocated", None),
10981098
"default": 0,
10991099
}
11001100

0 commit comments

Comments
 (0)