Today I’m  doing  the  CNN multi-class prediction,  and  I  wan  to   output   the  probability  about   every  class,   but     in   pytorch ,  the   nn.CrossEntropyLoss   contains   a   log_softmax(),and  the  nn.NLLLoss
function  also  need  log_softmax()  in  the last  layer  ,so  maybe  there is  no  loss  funtion  for  softmax.
But   I  can train  the   model  as  usual   with   using
nn.CrossEntropyLoss
and  the last  layer  is  just  a      nn.Linear()  layer,
At  last ,when  I  want  to  get  the    softmax    probability,    I  can  use  like  this  :
out_put=model(intput)
probability= torch.nn.functional.softmax(out_put,dim=1)
Now the  probability  is   same  as  what  you  get  in  tensorflow  or keras   softmax