Sole usage of Python 3.10's match-case in the project hinders quick-start for beginners; consider replacing with if-else for improved accessibility.
@@ -20,7 +20,6 @@ def get_param(model) -> torch.nn.Parameter:
def float64(t: torch.Tensor):
"""return torch.float64 if device is not mps or xpu, else return torch.float32"""
- match t.device.type:
- case 'mps', 'xpu':
- return torch.float32
+ if t.device.type in ['mps', 'xpu']:
+ return torch.float32
return torch.float64