Download scripts/test_cuda_device.py from DesonDai/CAVI: direct link, hf CLI and curl.
- Browser
- Download file 173 Bytes
-
https://huggingface.co/datasets/DesonDai/CAVI/resolve/main/scripts/test_cuda_device.py
- Command line
-
hf download hf://datasets/DesonDai/CAVI/scripts/test_cuda_device.py
-
curl -L -o test_cuda_device.py https://huggingface.co/datasets/DesonDai/CAVI/resolve/main/scripts/test_cuda_device.py
173 Bytes
| import torch | |
| print("available", torch.cuda.is_available()) | |
| tensor = torch.zeros(1, device="cuda") | |
| print("allocated", tensor) | |
| print("device", torch.cuda.get_device_name(0)) | |