From e8005781bea5003793eb2814708b6e2de5675660 Mon Sep 17 00:00:00 2001 From: Shayekh Bin Islam Date: Tue, 5 Sep 2023 17:18:48 +0000 Subject: [PATCH] Softmax in functorch example fixed (#107988) The output of softmax was overwritten by the output of fc2 in the following line. So, the output of the softmax is never utilized. Now, the final output of the model includes softmax. Pull Request resolved: https://github.com/pytorch/pytorch/pull/107988 Approved by: https://github.com/zou3519 --- functorch/notebooks/per_sample_grads.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functorch/notebooks/per_sample_grads.ipynb b/functorch/notebooks/per_sample_grads.ipynb index 5f7ad23880b5e8..a34c80d07ac4ac 100644 --- a/functorch/notebooks/per_sample_grads.ipynb +++ b/functorch/notebooks/per_sample_grads.ipynb @@ -60,7 +60,7 @@ " x = self.fc1(x)\n", " x = F.relu(x)\n", " x = self.fc2(x)\n", - " output = F.log_softmax(x, dim=1)\n", + " x = F.log_softmax(x, dim=1)\n", " output = x\n", " return output\n", "\n",