class Mymodel(nn.Module):
def init(self:
super(Mymodel, self).init()
    self.conv1 = nn.Conv2d(...)
    self.conv2= Myconv(...)

def forward(self, x, conv2=False):
    
    if conv2:
        self.conv2.weight.data = self.conv1.weight.data    
        out  = self.conv2(x)
    else:
        out  = self.conv1(x)
    return out

model = Mymodel()
output = model(input, conv2=True)
In the above example, I want to do a forward pass in which my input is fed to conv2 instance and in backward pass, the weghts for conv1 needs to be updated. But when I do a loss.backward(), it is actually going to the backward function for conv2 instead I want it to go to backward function for conv1.
Is it possible that when I do loss.backward() it goes through the backward function for conv1?