Solved by KFrank in post #4 
              
              
                Hi James! 

If I understand your question correctly, you can just use weights of 0.0 
and 1.0 to do this. 
Let’s say that the input to your model is a batch of images of shape 
[nBatch, height, width], and that the output of your model (which 
will be the input to BCEWithLogitsLoss) and the target y…