Skip to content

Commit d3e8678

Browse files
faaanyhlky
andauthored
Update tests/pipelines/controlnet/test_controlnet.py
Co-authored-by: hlky <[email protected]>
1 parent e799516 commit d3e8678

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

tests/pipelines/controlnet/test_controlnet.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -951,10 +951,7 @@ def test_sequential_cpu_offloading(self):
951951
output_type="np",
952952
)
953953

954-
if torch_device == "cuda":
955-
mem_bytes = torch.cuda.max_memory_allocated()
956-
elif torch_device == "xpu":
957-
mem_bytes = torch.xpu.max_memory_allocated()
954+
mem_bytes = backend_max_memory_allocated(torch_device)
958955
# make sure that less than 7 GB is allocated
959956
assert mem_bytes < 4 * 10**9
960957

0 commit comments

Comments
 (0)