Doubt about the difference between weight and pos_weight in binary_cross_entropy_loss

Hi,

I have a doubt related to the weighting on binary cross entropy. I was checking the two available functions: torch.nn.functional. binary_cross_entropy and torch.nn.functional. binary_cross_entropy_with_logits. As far as I understood the only difference between both functions is that the second one integrates the sigmoid. However, I found another difference. I observed that binary_cross_entropy_with_logits has two parameters to weight the loss: weight and pos_weight. Whereas the binary_cross_entropy just has the weight parameter.

I would like to understand in which scenarios is useful each of the weight parameters, and why the binary_cross_entropy just has one parameter to weight the loss.

Thanks!