repo.or.cz
/
ArchLinux
/
community.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
upgpkg: ufw 0.36.2-1
[ArchLinux/community.git]
/
python-pytorch-rocm
/
trunk
/
test.py
blob
28919175e8b3e2d79f8244ed4ed77add0a5d2ca4
1
#!/usr/bin/env python
2
3
import
torch
4
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"
)