Merge pull request #16088 from cuba3/dev_cuba3

Maintaining Project Compatibility for Python 3.9 Users Without Upgrade Requirements.
This commit is contained in:
AUTOMATIC1111 2024-07-06 09:52:40 +03:00 committed by GitHub
commit edebe4d4de
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 3 deletions

View File

@ -20,7 +20,6 @@ def get_param(model) -> torch.nn.Parameter:
def float64(t: torch.Tensor): def float64(t: torch.Tensor):
"""return torch.float64 if device is not mps or xpu, else return torch.float32""" """return torch.float64 if device is not mps or xpu, else return torch.float32"""
match t.device.type: if t.device.type in ['mps', 'xpu']:
case 'mps', 'xpu': return torch.float32
return torch.float32
return torch.float64 return torch.float64