Hugging Face
Models
Datasets
Spaces
Posts
Docs
Solutions
Pricing
Log In
Sign Up
Spaces:
Zafaflahfksdf
/
_
like
0
Runtime error
App
Files
Files
Community
da3eeba
_
/
ia_devices.py
Zafaflahfksdf
Upload folder using huggingface_hub
da3eeba
verified
3 months ago
raw
Copy download link
history
blame
Safe
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()