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-14 20:19:44 -0600
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
4390781086c33080a8009480c8c1d8770e2c0d55
43907810
1 parent
14cabc2d
NPU examples
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
1 deletions
ejemplo-npu/mnist_npu_example_v2.py
ejemplo-npu/quick_verification.py
ejemplo-npu/mnist_npu_example_v2.py
View file @
4390781
...
...
@@ -114,6 +114,15 @@ def main():
train_kwargs
.
update
(
cuda_kwargs
)
test_kwargs
.
update
(
cuda_kwargs
)
datasets
.
MNIST
.
resources
=
[
(
'https://ossci-datasets.s3.amazonaws.com/mnist/train-images-idx3-ubyte.gz'
,
'f68b3c2dcbeaaa9fbdd348bbdeb94873'
),
(
'https://ossci-datasets.s3.amazonaws.com/mnist/train-labels-idx1-ubyte.gz'
,
'd53e105ee54ea40749a09fcbcd1e9432'
),
(
'https://ossci-datasets.s3.amazonaws.com/mnist/t10k-images-idx3-ubyte.gz'
,
'9fb629c4189551a2d022fa330f9573f3'
),
(
'https://ossci-datasets.s3.amazonaws.com/mnist/t10k-labels-idx1-ubyte.gz'
,
'ec29112dd5afa0611ce80d1b7f02629c'
)
]
transform
=
transforms
.
Compose
([
transforms
.
ToTensor
(),
transforms
.
Normalize
((
0.1307
,),
(
0.3081
,)),
...
...
ejemplo-npu/quick_verification.py
View file @
4390781
...
...
@@ -2,7 +2,7 @@ import torch
import
torch.npu
print
(
"NPU available?"
,
torch
.
npu
.
is_available
())
print
(
"Current device"
,
torch
.
npu
.
current_device
())
print
(
"Current device
:
"
,
torch
.
npu
.
current_device
())
device
=
torch
.
device
(
"npu:0"
)
# x = torch.randn(2, 2).npu()
# y = torch.randn(2, 2).npu()
...
...
Please
register
or
login
to post a comment