mirror of
https://github.com/vladmandic/automatic
synced 2026-09-20 01:31:13 +02:00
fix code formatting under modules/dml
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user