please try to understand the code provided by @RaLo4. he explained in detail that you need to pass your logits from sigmoid function. This will convert raw logits to probabilities which you can use for round() function.



 RaLo4:

outputs = torch.sigmoid(outputs).cpu()