Hi,
The problem is with your QIL() layer.
Why do you wrap the result into a torch.nn.Parameter(x)? nn.Parameters are only to store parameters created during initialization of nn.Modules.
Also, if you don’t want to keep the original weights of the convolutions and replace them at forward by the ones you compute, you should do del self.conv5.weight in the init so that these weight are not considered learnable parameters and you will be able to set it during the forward.