I’m not sure I understand the issue correctly, as you wouldn’t pass the targets to the model (or conv layer as mentioned in your post).
Assuming you are working on a multi-label classification, you could create a multi-hot encoded target and use nn.BCEWithLogitsLoss as the criterion. Each active class would then be represented by a 1 in the target, while inactive classes would get a 0.