Softmax

代码

import torchimport torch.nn as nnsoftmax = nn.Softmax(dim=1) input = torch.randn(1, 10) output = softmax(input) print(output.size())torch.Size([1, 10])                  

援用

<1>

torch=1.7.1+cu101torchvision=0.8.2torchaudio=0.7.2