Solved by pascal_notsawo in post #2 
              
              
                It is possible. 
Just make w1.requires_grad = True ~~ w1.requires_grad_(True) and w2.requires_grad_(False). 
Look at the example below. 
import torch
class Model(torch.nn.Module) :
    def __init__(self) :
        super().__init__()
        self.w1 = torch.nn.parameter.Parameter(data = torch.tensor(…