class NeuraNetworkClass(nn.Module):  # --> This is learnable Neural Network
    def __init__(self,):
        super().__init__()
        self.fc1 = nn.Linear(.......)
        ..........
        ..........

    def forward(self, x)
        return self.fc1(x)


class NonNeuralNetworkClass(nn.Module):  # This is non learnable nn.Module class(no neural networks in this class)
    def __init__(self, model):
        super().__init__()
        self.model = model

    def forward(self, a, b):
        return self.model(a) + self.model(b)

model = NeuraNetwork1()
net = NonNeuralNetworkClass(model)

optim = torch.optim.Adam(lr=1e-4, params=model.parameters())

for epoch in rannge(100):
    loss = loss_func(net(a=inp1, b=inp2), labels)
    optim.zero_grad()
    loss.backward()
    optim.step()

Problem: With the above structure of coding, model parameters are not updating and gradients of model parameters are zero in every iteration.
Question: I have passed the model as an argument to the init method of NonNeuralNetworkClass. So, does the forward method of NonNeuralNetworkClass gets the updated
parameters of the model or do we need to pass the model every time in forward method of NonNeuralNetworkClass whenever the model parameter gets updated??