Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Carlos-Francisco Méndez-Cruz
/
curso-alianza-2024
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
cmendezc
2024-10-23 17:02:16 -0600
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
f11ed5a173325c17b03d06fbec2403af72281597
f11ed5a1
1 parent
cd2dc1bb
NPU examples
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
ejemplo-npu/quick_verification_torch1.11.py
ejemplo-npu/quick_verification_torch1.11.py
0 → 100644
View file @
f11ed5a
import
torch
import
torch_npu
print
(
"NPU available?"
,
torch
.
npu
.
is_available
())
print
(
"Current device:"
,
torch
.
npu
.
current_device
())
device
=
torch
.
device
(
"npu:0"
)
# x = torch.randn(2, 2).npu()
# y = torch.randn(2, 2).npu()
x
=
torch
.
randn
(
2
,
2
)
.
to
(
device
)
y
=
torch
.
randn
(
2
,
2
)
.
to
(
device
)
z
=
x
.
mm
(
y
)
print
(
z
)
\ No newline at end of file
Please
register
or
login
to post a comment