mirror of
https://github.com/vladmandic/automatic
synced 2026-09-19 17:24:32 +02:00
simplify get_device.
This commit is contained in:
@@ -4,5 +4,5 @@ import torch
|
||||
rDevice = torch.device | int
|
||||
def get_device(device: Optional[rDevice]=None) -> torch.device:
|
||||
if device is None:
|
||||
device = torch.dml.context_device or torch.dml.current_device()
|
||||
device = torch.dml.current_device()
|
||||
return torch.device(device)
|
||||
|
||||
Reference in New Issue
Block a user