pytorch按batch softmax Posted on 2018-12-Tue Views: Views: 123x = Variable(torch.cat((torch.ones(1, 1, 10, 10), torch.ones(1, 1, 10, 10)*2), dim=0))softmax = nn.Softmax(dim=1)y = softmax(x.view(2, -1)).view(2, 1, 10, 10)