Solved by tom in post #2 
              
              
                You need to either wrap them in nn.Parameter (for learnable) or use self.register_buffer to let the model know that they are part of its state. 
Best regards 
Thomas