_ / ia_devices.py
Zafaflahfksdf's picture
Upload folder using huggingface_hub
da3eeba verified
raw
history blame contribute delete
221 Bytes
import torch
class TorchDevices:
def __init__(self):
self.cpu = torch.device("cpu")
self.device = torch.device("cuda") if torch.cuda.is_available() else self.cpu
devices = TorchDevices()