Fix empty device issue (#904)

This commit is contained in:
Sebastian Raschka
2025-11-05 20:04:44 -06:00
committed by GitHub
parent bcc73f731d
commit 58f45ae5a7
6 changed files with 13 additions and 0 deletions

View File

@@ -1156,6 +1156,8 @@
" major, minor = map(int, torch.__version__.split(\".\")[:2])\n",
" if (major, minor) >= (2, 9):\n",
" device = torch.device(\"mps\")\n",
" else:\n",
" device = torch.device(\"cpu\")\n",
"else:\n",
" device = torch.device(\"cpu\")\n",
"\n",