Skip to content

Commit

Permalink
update add device setting
Browse files Browse the repository at this point in the history
  • Loading branch information
inoue0426 committed Jul 8, 2024
1 parent 2b70900 commit 0cfc21d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,7 @@
"source": [
"tmp = !ls | grep pt\n",
"device = torch.device(\"cuda\" if torch.cuda.is_available() else \"cpu\")\n",
"model = torch.load(tmp[0])"
"model = torch.load(tmp[0], map_location=device)"
]
},
{
Expand Down Expand Up @@ -902,9 +902,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "py39",
"display_name": "torch",
"language": "python",
"name": "py39"
"name": "torch"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -916,7 +916,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.17"
"version": "3.11.9"
}
},
"nbformat": 4,
Expand Down

0 comments on commit 0cfc21d

Please sign in to comment.