Dear K. Frank,
Thank you for your time looking into it, I switched from the BCE loss to CEL because of absence in the BCE the option to add the class weights.
I however did not yet see the BCE with Logits Loss yet.
Am I right that

here the output and target will be of the same shape?
I remove sigmoid activation at the end as it is already part of the BCEWithLogitsLoss

Thank you again and best regards,
Alice