Solved by ptrblck in post #11 
              
              
                You don’t need to use torch.exp, if you’ve used F.sigmoid in your model. 
Also, you should use a threshold on the probabilities to get the corresponding class, e.g. 0.5. 
tensor.topk will return a zero tensor in your current setup.