Skip to content

Commit

Permalink
[doc] fix device issue (#6660)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rhett-Ying authored Dec 1, 2023
1 parent dcc227d commit bdaa130
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions notebooks/graphbolt/walkthrough.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,9 @@
"os.environ['TORCH'] = torch.__version__\n",
"os.environ['DGLBACKEND'] = \"pytorch\"\n",
"\n",
"# Uncomment below to install required packages. If the CUDA version is not 11.8,\n",
"# check the https://www.dgl.ai/pages/start.html to find the supported CUDA\n",
"# version and corresponding command to install DGL.\n",
"# !pip install --pre dgl -f https://data.dgl.ai/wheels-test/cu118/repo.html > /dev/null\n",
"# Install the CPU version.\n",
"device = torch.device(\"cpu\")\n",
"!pip install --pre dgl -f https://data.dgl.ai/wheels-test/repo.html\n",
"\n",
"try:\n",
" import dgl.graphbolt as gb\n",
Expand Down Expand Up @@ -259,7 +258,7 @@
},
"outputs": [],
"source": [
"datapipe = datapipe.copy_to(device=\"cuda\")\n",
"datapipe = datapipe.copy_to(device=device)\n",
"print(next(iter(datapipe)))"
]
},
Expand Down Expand Up @@ -318,7 +317,6 @@
"metadata": {
"accelerator": "GPU",
"colab": {
"authorship_tag": "ABX9TyOCdFtYQweXnIR1/5oWDSGq",
"collapsed_sections": [
"BjkAK37xopp1"
],
Expand All @@ -336,4 +334,4 @@
},
"nbformat": 4,
"nbformat_minor": 0
}
}

0 comments on commit bdaa130

Please sign in to comment.