If you are using nn.BCE(WithLogits)Loss, the target should have the same shape as your output activation, where the channel index corresponds to the class index.
A one indicates the presence of the class at this spatial position, while a zero does not.