Showing
2 changed files
with
10 additions
and
1 deletions
... | @@ -114,6 +114,15 @@ def main(): | ... | @@ -114,6 +114,15 @@ def main(): |
114 | train_kwargs.update(cuda_kwargs) | 114 | train_kwargs.update(cuda_kwargs) |
115 | test_kwargs.update(cuda_kwargs) | 115 | test_kwargs.update(cuda_kwargs) |
116 | 116 | ||
117 | + datasets.MNIST.resources = [ | ||
118 | + ( | ||
119 | + 'https://ossci-datasets.s3.amazonaws.com/mnist/train-images-idx3-ubyte.gz', 'f68b3c2dcbeaaa9fbdd348bbdeb94873'), | ||
120 | + ( | ||
121 | + 'https://ossci-datasets.s3.amazonaws.com/mnist/train-labels-idx1-ubyte.gz', 'd53e105ee54ea40749a09fcbcd1e9432'), | ||
122 | + ('https://ossci-datasets.s3.amazonaws.com/mnist/t10k-images-idx3-ubyte.gz', '9fb629c4189551a2d022fa330f9573f3'), | ||
123 | + ('https://ossci-datasets.s3.amazonaws.com/mnist/t10k-labels-idx1-ubyte.gz', 'ec29112dd5afa0611ce80d1b7f02629c') | ||
124 | + ] | ||
125 | + | ||
117 | transform=transforms.Compose([ | 126 | transform=transforms.Compose([ |
118 | transforms.ToTensor(), | 127 | transforms.ToTensor(), |
119 | transforms.Normalize((0.1307,), (0.3081,)), | 128 | transforms.Normalize((0.1307,), (0.3081,)), | ... | ... |
... | @@ -2,7 +2,7 @@ import torch | ... | @@ -2,7 +2,7 @@ import torch |
2 | import torch.npu | 2 | import torch.npu |
3 | 3 | ||
4 | print("NPU available?", torch.npu.is_available()) | 4 | print("NPU available?", torch.npu.is_available()) |
5 | -print("Current device", torch.npu.current_device()) | 5 | +print("Current device:", torch.npu.current_device()) |
6 | device = torch.device("npu:0") | 6 | device = torch.device("npu:0") |
7 | # x = torch.randn(2, 2).npu() | 7 | # x = torch.randn(2, 2).npu() |
8 | # y = torch.randn(2, 2).npu() | 8 | # y = torch.randn(2, 2).npu() | ... | ... |
-
Please register or login to post a comment