@ptrblck
Another question. Let say I have two models(M and K) that are built with a superclass of nn.Module. And function M predicts the values of the parameters for the network K. Now I just want to use network M for training which predicts the parameter values for network K. In other words, I just need to send network M parameters for optimizer and take gradient wrt network M’s parameters.  But when I instantiate both M and K classes before the training itself, I see grad=True for both M and K network parameters and also parameters of M and K initialized. For me it makes sense to see the grad=True and parameters values initialized for network M because it will be used for training and I am not understanding why the K.parameters() also has values and grad=True?
How can I use the network K only  for inference using estimated parameter values from network M?