Hi @albanD
Thanks for the reply!
conv2 (Myconv) is a class created by me using “Function” class in pytorch. Below is an example:
class Conv2d_mvm_function(Function):
@staticmethod
def forward(ctx, input, weight, bias):
    ...
    
    ...
    ctx.save_for_backward(input, weight, bias)
    
@staticmethod
def backward(ctx, grad_output):
    
    input, weight, bias = ctx.saved_tensors

So when I do a loss.backward() it goes to line “ctx.saved_tensors” in my backward function, but I keep on getting this error “*** RuntimeError: No grad accumulator for a saved leaf!”
What is the reason for this error?
The require grad for input and weight is True.
Also i am using double backward. Is there any problem with double backward?
What is the other way other than using *.data to make weights for self.conv2 to be equal to weights of self.conv1?