Hugging Face
Models
Datasets
Spaces
Buckets
new
Docs
Enterprise
Pricing
Log In
Sign Up
xcx0902
/
Multiplication
like
0
Safetensors
Model card
Files
Files and versions
xet
Community
2eebda5
Multiplication
/
device.py
xcx0902
Upload folder using huggingface_hub
2eebda5
verified
11 months ago
raw
Copy download link
history
blame
Safe
140 Bytes
import
torch
device:
str
if
torch.cuda.is_available(): device =
'cuda'
elif
torch.mps.is_available(): device =
'mps'
else
: device =
'cpu'