Solved by ptrblck in post #6 
              
              
                Ah sorry, I misunderstood your use case. 
My first code should work then: 
y = nn.Softmax(2)(x.view(*x.size()[:2], -1)).view_as(x)
print(y[0, 1].sum())

Are you sure it’s not working?