“No grad accumulator for a saved leaf!”
I solved this error.  I made requires_gard=False for the parameters for which I didn’t want to calculate the grads
“What is the other way other than using *.data to make weights for self.conv2 to be equal to weights of self.conv1?”
I have two tensors because I train with nn.conv2d and I infer with my conv implementation. What is the most efficient way for conv2 and conv1 to share weights for all the epochs. Basically the change in weight for conv1 should reflect in conv2 weight as well. I tried using the below line in my init:
self.conv2.weight.data = self.conv1.weight.detach()
But I think this would only make weight equal when init is called while initialising the model. The changes in conv1.weight won’t reflect on conv2 weights in subsequent epochs.
One way is to make the weight of conv2 and conv1 equal in forward function. But is there some other way to do so?