Hi, @ptrblck
thank you very much for your answer.
In my case, I have more than one conv layers, and for almost all of these layers, I have to fix part of the parameters of the layer. Is there a convenient way?
If I use conv.weight.grad[:, :, 1, 1] = 0.  I have to do this for every layers, which is not elegant and convenient.