I implemented something like this:
self.weight = torch.randn((2, 4, 6), requires_grad = True)
self.convnet1 = nn.Sequential(
nn.Conv1d(2, 4, kernel_size=6, stride=1, padding=1),
nn.ReLU(inplace=True),)
self.convnet1.weight = nn.Parameter(self.weight)
But the weights are not updating…