mirror of
https://github.com/vladmandic/automatic
synced 2026-09-20 01:31:13 +02:00
IPEX fix fp64 hijack
This commit is contained in:
@@ -259,7 +259,7 @@ def Tensor_to(self, device=None, *args, **kwargs):
|
||||
return self.original_Tensor_to(return_xpu(device), *args, **kwargs)
|
||||
else:
|
||||
if not device_supports_fp64:
|
||||
if kwargs.get("dtype", None) == torch.float64 and torch.device(device).type == "xpu":
|
||||
if kwargs.get("dtype", None) == torch.float64 and ((device is None and self.device.type == "xpu") or (device is not None and torch.device(device).type == "xpu")):
|
||||
kwargs["dtype"] = torch.float32
|
||||
elif device == torch.float64 and self.device.type == "xpu":
|
||||
device = torch.float32
|
||||
|
||||
Reference in New Issue
Block a user