Skip to content

Commit edebe4d

Browse files
Merge pull request #16088 from cuba3/dev_cuba3
Maintaining Project Compatibility for Python 3.9 Users Without Upgrade Requirements.
2 parents b9c3f4e + 9e60cdb commit edebe4d

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

modules/torch_utils.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ def get_param(model) -> torch.nn.Parameter:
2020

2121
def float64(t: torch.Tensor):
2222
"""return torch.float64 if device is not mps or xpu, else return torch.float32"""
23-
match t.device.type:
24-
case 'mps', 'xpu':
25-
return torch.float32
23+
if t.device.type in ['mps', 'xpu']:
24+
return torch.float32
2625
return torch.float64

0 commit comments

Comments
 (0)