Development Verification
Run the following command to perform the verification.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | python3 - <<'PY' import torch print("torch_version=" + torch.__version__) print("cuda_built=" + str(torch.backends.cuda.is_built())) print("torch_cuda_version=" + str(torch.version.cuda)) print("cuda_available=" + str(torch.cuda.is_available())) assert torch.backends.cuda.is_built() assert str(torch.version.cuda).startswith("13.0") assert torch.cuda.is_available() x = torch.tensor([[1.0, 2.0], [3.0, 4.0]]) y = torch.tensor([[5.0, 6.0], [7.0, 8.0]]) print("gpu_matmul=" + str((x.cuda() @ y.cuda()).cpu().tolist())) PY |
The expected output is as follows.
1 2 3 4 5 | torch_version=2.11.0 cuda_built=True torch_cuda_version=13.0 cuda_available=True gpu_matmul=[[19.0, 22.0], [43.0, 50.0]] |
Parent topic: Development Guide