mirror of
https://github.com/rasbt/LLMs-from-scratch.git
synced 2026-04-10 12:33:42 +00:00
use torch.softmax instead of F.softmax
This commit is contained in:
@@ -700,7 +700,7 @@
|
||||
],
|
||||
"source": [
|
||||
"with torch.no_grad():\n",
|
||||
" out = F.softmax(model(X), dim=1)\n",
|
||||
" out = torch.softmax(model(X), dim=1)\n",
|
||||
"print(out)"
|
||||
]
|
||||
},
|
||||
@@ -986,7 +986,7 @@
|
||||
],
|
||||
"source": [
|
||||
"torch.set_printoptions(sci_mode=False)\n",
|
||||
"probas = F.softmax(outputs, dim=1)\n",
|
||||
"probas = torch.softmax(outputs, dim=1)\n",
|
||||
"print(probas)\n",
|
||||
"\n",
|
||||
"predictions = torch.argmax(outputs, dim=1)\n",
|
||||
|
||||
Reference in New Issue
Block a user