upgpkg: ufw 0.36.2-1
[ArchLinux/community.git] / python-pytorch-rocm / trunk / test.py
blob28919175e8b3e2d79f8244ed4ed77add0a5d2ca4
1 #!/usr/bin/env python
3 import torch
5 if torch.cuda.is_available() and torch.version.hip:
6 d = torch.device('cuda')
7 a = torch.rand(1, 2).to(d)
8 print(a + 0)
9 print("TESTS PASSED!")
10 else:
11 print("ROCm not supported with PyTorch installation")