fix code formatting under modules/dml

This commit is contained in:
Seunghoon Lee
2024-02-05 22:43:10 +09:00
parent ef29f1a238
commit ff2c1db1cc
19 changed files with 91 additions and 46 deletions
+4 -4
View File
@@ -1,14 +1,14 @@
from typing import Optional
import torch
from .utils import rDevice, get_device
class device:
class Device:
def __enter__(self, device: Optional[rDevice]=None):
torch.dml.context_device = get_device(device)
def __init__(self, device: Optional[rDevice]=None) -> torch.device:
def __init__(self, device: Optional[rDevice]=None) -> torch.device: # pylint: disable=return-in-init
return get_device(device)
def __exit__(self, type, val, tb):
def __exit__(self, t, v, tb):
torch.dml.context_device = None