Solved by ptrblck in post #2 
              
              
                You could try to use e.g. nn.MultiLabelMarginLoss, which is the multi-classification hinge loss and create the desired targets for your “One Class SVM”.