An SVM would also be a classifier, so I assume “instead of a classifier” means the model.classifier module.
It’s possible to feed your model outputs to other classifiers and the overall workflow depends what should be trained and which part of the model would be frozen.
E.g. if you do not want to train the PyTorch model anymore, but just use it’s features to train an SVM or another model, you could transform the outputs to numpy arrays and use e.g. scikit-learn or any other Python library.
However, if you want to train the PyTorch model, this won’t work out of the box, since Autograd won’t be able to track the numpy operations in the scikit-learn model and you would thus detach the computation graph by leaving PyTorch.
You could try to write the backward functions for all numpy operations manually via custom torch.autograd.Functions as described here 1 or use MultiMarginLoss 2, which should be similar to the HingeLoss used in SVMs (I haven’t looked deeply into potential differences, but if I recall correctly, other users were using this criterion for the “SVM loss”).