From 22442b7012031e41574d8e61aaf5b52042014e88 Mon Sep 17 00:00:00 2001 From: rasbt Date: Sun, 28 Jan 2024 12:25:49 -0600 Subject: [PATCH] use torch.softmax instead of F.softmax --- appendix-A/03_main-chapter-code/code-part1.ipynb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/appendix-A/03_main-chapter-code/code-part1.ipynb b/appendix-A/03_main-chapter-code/code-part1.ipynb index 39e3f2e..71490fa 100644 --- a/appendix-A/03_main-chapter-code/code-part1.ipynb +++ b/appendix-A/03_main-chapter-code/code-part1.ipynb @@ -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",