Skip to content

Commit

Permalink
Softmax in functorch example fixed (pytorch#107988)
Browse files Browse the repository at this point in the history
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: pytorch#107988
Approved by: https://github.com/zou3519
  • Loading branch information
ShayekhBinIslam authored and pytorchmergebot committed Sep 5, 2023
1 parent e787708 commit e800578
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion functorch/notebooks/per_sample_grads.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit e800578

Please sign in to comment.