When I using

Blockquote ```
x = F.softmax(x, dim=1)
x = torch.log(x)

to replace

> Blockquote ```
x = F.log_softmax(x, dim=1)

something wrong happend. But if I use " F.log_softmax" directly, everything went well. Then I subtracted the former and the latter, and found that they were not exactly the same.  I want to know how to divide “F.log_softmax” into “F.softmax” and “torch.log” correctly, I need the result of “F.softmax”. Thank you very much!
(PS:I had subtracted the maximum to prevent the softmax overflow, but the training still reported an error)

QQ图片20200330210157_看图王929×317 16.5 KB