Solved by ptrblck in post #2 
              
              
                It seems you are trying to initialize self.params as the trainable parameters in the model, which is not the case at the moment, since you are not registering the tensor and would need to use nn.Parameter(torch.ones(...)) instead. This will make sure this parameter will be properly registered and e.…