Pytorch torch.nn.functional.softmax: What dimension to use?
torch.nn.functional.softmax
https://stackoverflow.com/questions/49036993/pytorch-softmax-what-dimension-to-use
Pytorch softmax: What dimension to use?
Image transcribed as code:
>>> x = torch.tensor([[1,2],[3,4]],dtype=torch.float)
>>> F.softmax(x,dim=0)
tensor([[0.1192, 0.1192],
[0.8808, 0.8808]])
>>> F.softmax(x,dim=1)
tensor([[0.2689, 0.7311],
[0.2689, 0.7311]])