Check the weights of your model, if they require grads with a for loop like this:

for param in model.parameters():
    print( param.require_grad )


If you don’t want to train the model why are you backpropagating the loss? What do you use the computed gradient for?