Implement 1D signal convolution

Hi
I am trying to build a FCNN to solve deconvolution. This is quite similar as inverse problem in image. I have one detected signal and one kernel function. I want to get true signal. The relationship between detected signal, kernel function and true signal is: detected signal = true signal conv kernel.
The idea is quite simple: I build a FCNN

class DeconvolutionNN(nn.Module):
def init(self):
super(DeconvolutionNN, self).init()
self.layer1 = nn.Linear(149, 64)
self.layer2 = nn.Linear(64, 32)
self.layer3 = nn.Linear(32, 149)
#self.layer4 = nn.Linear(256, 149)
self.relu = nn.ReLU()

def forward(self, x):
    x = self.relu(self.layer1(x))
    x = self.relu(self.layer2(x))
    #x = self.relu(self.layer3(x))
    x = self.layer3(x)  
    return x

The output of this FCNN is a random true signal and I am trying to minimize the L2 loss of true signal - random true signal conv kernel.
I am confused here since the torch.nn.functional.conv1d is not traditional signal convolution. It calculates the cross correlation here. I want to call Scipy.signal.convolve here but this will cause a problem that scipy won’t track the gradient. Is there any thought that how can I solve this problem?

Any help would be much appreciated

You could flip the signal to perform a convolution instead of a cross-correlation.