Unverified Commit bdaa1309 authored by Rhett Ying's avatar Rhett Ying Committed by GitHub
Browse files

[doc] fix device issue (#6660)

parent dcc227d7
...@@ -27,10 +27,9 @@ ...@@ -27,10 +27,9 @@
"os.environ['TORCH'] = torch.__version__\n", "os.environ['TORCH'] = torch.__version__\n",
"os.environ['DGLBACKEND'] = \"pytorch\"\n", "os.environ['DGLBACKEND'] = \"pytorch\"\n",
"\n", "\n",
"# Uncomment below to install required packages. If the CUDA version is not 11.8,\n", "# Install the CPU version.\n",
"# check the https://www.dgl.ai/pages/start.html to find the supported CUDA\n", "device = torch.device(\"cpu\")\n",
"# version and corresponding command to install DGL.\n", "!pip install --pre dgl -f https://data.dgl.ai/wheels-test/repo.html\n",
"# !pip install --pre dgl -f https://data.dgl.ai/wheels-test/cu118/repo.html > /dev/null\n",
"\n", "\n",
"try:\n", "try:\n",
" import dgl.graphbolt as gb\n", " import dgl.graphbolt as gb\n",
...@@ -259,7 +258,7 @@ ...@@ -259,7 +258,7 @@
}, },
"outputs": [], "outputs": [],
"source": [ "source": [
"datapipe = datapipe.copy_to(device=\"cuda\")\n", "datapipe = datapipe.copy_to(device=device)\n",
"print(next(iter(datapipe)))" "print(next(iter(datapipe)))"
] ]
}, },
...@@ -318,7 +317,6 @@ ...@@ -318,7 +317,6 @@
"metadata": { "metadata": {
"accelerator": "GPU", "accelerator": "GPU",
"colab": { "colab": {
"authorship_tag": "ABX9TyOCdFtYQweXnIR1/5oWDSGq",
"collapsed_sections": [ "collapsed_sections": [
"BjkAK37xopp1" "BjkAK37xopp1"
], ],
...@@ -336,4 +334,4 @@ ...@@ -336,4 +334,4 @@
}, },
"nbformat": 4, "nbformat": 4,
"nbformat_minor": 0 "nbformat_minor": 0
} }
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment