_
File size: 221 Bytes
da3eeba
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
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()