BCELoss Backward When The Input is Zero

I’m not completely sure, what you are trying to achieve, but you might saturate the sigmoid function with high or low values as shown in this post.