How to generation / update parameter?

Hello everybody!!

i want weight generation and weight update
So I want to know how to update the network that generates the weights.

class Network:
  def __init__(self):
    self.conv = nn.Conv2d(3, 64, kernel_size=kernel_size, stride=1, padding=1)

  def forward(self, x)
    filters = generation_weight_network()
    self.conv.weight = torch.nn.Parameter(filters)
    x = self.conv(x)
    return x

what is the problem??

If you want to assign new weight in conv module, you delete the weight in the module first.

I want to create a filter and assign it as the weight of conv.
So I want to update both the weight of the network that creates the filter and the original network.