IPEX fix DPM2++ FlowMatch

This commit is contained in:
Disty0
2025-06-17 19:58:20 +03:00
parent 26800a1ef9
commit d8aaffbc27
+7
View File
@@ -254,8 +254,15 @@ torch.Tensor.original_Tensor_to = torch.Tensor.to
@wraps(torch.Tensor.to)
def Tensor_to(self, device=None, *args, **kwargs):
if check_cuda(device):
if not device_supports_fp64 and kwargs.get("dtype", None) == torch.float64:
kwargs["dtype"] = torch.float32
return self.original_Tensor_to(return_xpu(device), *args, **kwargs)
else:
if not device_supports_fp64:
if kwargs.get("dtype", None) == torch.float64:
kwargs["dtype"] = torch.float32
elif device == torch.float64 and self.device.type == "xpu":
device = torch.float32
return self.original_Tensor_to(device, *args, **kwargs)
original_Tensor_cuda = torch.Tensor.cuda