Skip to content

Commit

Permalink
Compile test fix (huggingface#6104)
Browse files Browse the repository at this point in the history
* update

* update
  • Loading branch information
DN6 authored and Jimmy committed Apr 26, 2024
1 parent 86087cd commit a8221c5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/diffusers/utils/testing_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -820,7 +820,9 @@ def _is_torch_fp16_available(device):

try:
x = torch.zeros((2, 2), dtype=torch.float16).to(device)
_ = x @ x
_ = torch.mul(x, x)
return True

except Exception as e:
if device.type == "cuda":
raise ValueError(
Expand All @@ -838,7 +840,9 @@ def _is_torch_fp64_available(device):

try:
x = torch.zeros((2, 2), dtype=torch.float64).to(device)
_ = x @ x
_ = torch.mul(x, x)
return True

except Exception as e:
if device.type == "cuda":
raise ValueError(
Expand Down

0 comments on commit a8221c5

Please sign in to comment.