But, I wonder why the same functions are separated.
P.S.
what version of pytorch do you use?
my pytorch version is ‘0.3.0 post4’, this version doesn’t have a ‘reduce’ parameter in BCEWithLogitsLoss and MultiLabelSoftMarginLoss.
I’m using '0.4.0a0+5eefe87' (compiled a while ago from master).
You could update to 0.3.1, although the reduce argument will still be missing (doc) or compile from master.
You can find the build instructions here.
As far as I understand, BCEWithLogitsLoss is used for Binary Cross Entropy loss and MultiLabelSoftMarginLoss for Multi-Label Cross Entropy loss.
Sure, when you have a binary case both of them will give you the same result. But using BCEWithLogitsLoss for binary classification will make your code more readable and easier to comprehend.