Skip to content

Commit 03ec7c2

Browse files
Update MNIST_on_TPU.ipynb
1 parent 0be46fd commit 03ec7c2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

examples/notebooks/MNIST_on_TPU.ipynb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@
6767
"id": "4mnaxX3eXNGd"
6868
},
6969
"source": [
70-
"VERSION = \"1.5\"\n",
71-
"!curl https://raw.githubusercontent.com/pytorch/xla/master/contrib/scripts/env-setup.py -o pytorch-xla-env-setup.py\n",
72-
"!python pytorch-xla-env-setup.py --version $VERSION"
70+
"VERSION = !curl -s https://api.github.com/repos/pytorch/xla/releases/latest | grep -Po '\"tag_name\": \"v\\K.*?(?=\")'\n",
71+
"VERSION = VERSION[0].rstrip('.0') # remove trailing zero\n",
72+
"!pip install cloud-tpu-client==0.10 https://storage.googleapis.com/tpu-pytorch/wheels/torch_xla-{VERSION}-cp37-cp37m-linux_x86_64.whl"
7373
],
7474
"execution_count": null,
7575
"outputs": []
@@ -395,4 +395,4 @@
395395
"outputs": []
396396
}
397397
]
398-
}
398+
}

0 commit comments

Comments
 (0)