Hi,
You mean that you want to get the gradients for the elements in the classifier but not the ones in model?
If s, you can use autograd.grad to specify what you want the gradients for: grads = autograd.grad(loss, classifier.parameters()).