Hypernetwork implemnentation

I want to generate the weights for network 2 using network 1, for this assuming I have MLP for network 1, and then network 2 is a linear layer then we have:

Linear.weight = weight generated from network 2, requires_grad=False

is this the correct implementation of hyper-net?