Thanks for replying. But I want to pass the target indices, that is a constraint as I have a sparse matrix representation of binary vector and I wish to use that. Is there anyway to do it?
I don’t think you can use the index approach with the current nn.BCE(WithLogits)Loss implementation, since the target is a FloatTensor and thus contains the target for each data sample.
Would you be able to create the right target using scatter?