It looks like you are dealing with a multi-label calssification, i.e. each sample might have more than a single ground truth class.
If that’s the case, you could use nn.BCEWithLogitsLoss and use an output layer as:
nn.Linear(in_features, nb_classes)

Each unit in the output layer will be treated as giving the probability for the corresponding class independently.
The target should be a FloatTensor having the same shape as your model output in this case, e.g. [batch_size, nb_classes].
Let us know, if you need more information or get stuck somewhere.